Add OAuth Login facebook,google,github
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { LoginUser } from './loginResult'
|
||||
import { OAuthType } from './oauthType'
|
||||
import { LoginUser } from './loginUser'
|
||||
import { RegisterUserResult } from './registerUserResult'
|
||||
|
||||
export {
|
||||
LoginUser,
|
||||
RegisterUserResult
|
||||
}
|
||||
RegisterUserResult,
|
||||
OAuthType
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { BaseDomain } from 'core/domain/common'
|
||||
|
||||
export class LoginUser extends BaseDomain {
|
||||
|
||||
constructor (private _uid: string, private _emailVerified: boolean) {
|
||||
super()
|
||||
}
|
||||
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
public get uid (): string {
|
||||
return this._uid
|
||||
}
|
||||
|
||||
public get emailVerified (): boolean {
|
||||
return this._emailVerified
|
||||
}
|
||||
|
||||
}
|
||||
54
src/core/domain/authorize/loginUser.ts
Normal file
54
src/core/domain/authorize/loginUser.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { BaseDomain } from 'core/domain/common'
|
||||
|
||||
export class LoginUser extends BaseDomain {
|
||||
|
||||
constructor (
|
||||
private _uid: string,
|
||||
private _emailVerified: boolean,
|
||||
private _providerId: string = '',
|
||||
private _displayName: string = '',
|
||||
private _email: string = '',
|
||||
private _avatarURL: string = ''
|
||||
|
||||
) {
|
||||
super()
|
||||
}
|
||||
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
public get uid (): string {
|
||||
return this._uid
|
||||
}
|
||||
|
||||
/**
|
||||
* If user's email is verifide {true} or not {false}
|
||||
*
|
||||
* @readonly
|
||||
* @type {boolean}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
public get emailVerified (): boolean {
|
||||
return this._emailVerified
|
||||
}
|
||||
|
||||
public get providerId (): string {
|
||||
return this._providerId
|
||||
}
|
||||
|
||||
public get displayName (): string {
|
||||
return this._displayName
|
||||
}
|
||||
|
||||
public get email (): string {
|
||||
return this.email
|
||||
}
|
||||
|
||||
public get avatarURL (): string {
|
||||
return this._avatarURL
|
||||
}
|
||||
|
||||
}
|
||||
5
src/core/domain/authorize/oauthType.ts
Normal file
5
src/core/domain/authorize/oauthType.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export enum OAuthType {
|
||||
GITHUB = 'GITHUB',
|
||||
FACEBOOK = 'FACEBOOK',
|
||||
GOOGLE = 'GOOGLE'
|
||||
}
|
||||
@@ -1,23 +1,21 @@
|
||||
import { BaseDomain } from 'core/domain/common'
|
||||
|
||||
export class RegisterUserResult extends BaseDomain{
|
||||
export class RegisterUserResult extends BaseDomain {
|
||||
|
||||
constructor(uid: string){
|
||||
super()
|
||||
private _uid: string
|
||||
constructor (uid: string) {
|
||||
super()
|
||||
|
||||
this._uid = uid
|
||||
}
|
||||
this._uid = uid
|
||||
}
|
||||
/**
|
||||
* User identifier
|
||||
*
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginUser
|
||||
*/
|
||||
|
||||
private _uid : string
|
||||
public get uid (): string {
|
||||
return this._uid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public get uid (): string {
|
||||
return this._uid
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user