mirror of
https://github.com/MikroWizard/mikrofront.git
synced 2025-08-28 05:54:53 +02:00
add login with google and change
This commit is contained in:
parent
10d4cff4a4
commit
d8ed8ce2ce
25 changed files with 1946 additions and 468 deletions
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
// import { MikroWizardrpcProvider } from '../MikroWizardrpc/MikroWizardrpc';
|
||||
import { MikroWizardProvider } from './provider';
|
||||
|
||||
|
@ -10,13 +10,15 @@ import { User } from './user';
|
|||
export class dataProvider {
|
||||
|
||||
// public serverUrl: string = "/api";
|
||||
public serverUrl: string = "";
|
||||
public serverUrl: string = "http://192.168.1.26:3000";
|
||||
private db: string = "NothingImportant";
|
||||
private apiUrl: string = "/api";
|
||||
|
||||
constructor(
|
||||
// private http: HTTP,
|
||||
// public MikroWizardRPC: MikroWizardrpcProvider,
|
||||
public MikroWizardRPC: MikroWizardProvider,
|
||||
private http: HttpClient
|
||||
) {
|
||||
this.MikroWizardRPC.init({
|
||||
MikroWizard_server: this.serverUrl
|
||||
|
@ -628,4 +630,36 @@ export class dataProvider {
|
|||
getFullUrl(url: any) {
|
||||
return this.serverUrl + url;
|
||||
}
|
||||
|
||||
signup(username: string, organization: string, email: string, password: string) {
|
||||
var data = {
|
||||
'username': username,
|
||||
'organization': organization,
|
||||
'email': email,
|
||||
'password': password
|
||||
}
|
||||
return this.MikroWizardRPC.sendJsonRequest("/api/signup", data);
|
||||
}
|
||||
|
||||
async loginWithOffice365(tokenClaims: any): Promise<any> {
|
||||
try {
|
||||
const data = {
|
||||
tokenClaims: tokenClaims
|
||||
};
|
||||
return this.MikroWizardRPC.sendJsonRequest("/api/auth/office365", data);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async loginWithApple(appleResponse: any): Promise<any> {
|
||||
try {
|
||||
const data = {
|
||||
appleResponse: appleResponse
|
||||
};
|
||||
return this.MikroWizardRPC.sendJsonRequest("/api/auth/apple", data);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue