feat(sdk): add initial browser and server authentication SDK exports
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
export type TIdpAccountAuthSource = 'local' | 'idp.global';
|
||||
export type TIdpAccountRole = 'admin' | 'user';
|
||||
export type TIdpAccountStatus = 'active' | 'disabled';
|
||||
|
||||
export interface IIdpSdkAccount {
|
||||
id: string;
|
||||
email: string;
|
||||
emailNormalized: string;
|
||||
name: string;
|
||||
role: TIdpAccountRole;
|
||||
status: TIdpAccountStatus;
|
||||
authSources: TIdpAccountAuthSource[];
|
||||
passwordHash?: string;
|
||||
idpSubject?: string;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
lastLoginAt?: number;
|
||||
}
|
||||
|
||||
export interface ICreateIdpSdkAccountOptions {
|
||||
email: string;
|
||||
name: string;
|
||||
role: TIdpAccountRole;
|
||||
status?: TIdpAccountStatus;
|
||||
authSources: TIdpAccountAuthSource[];
|
||||
password?: string;
|
||||
idpSubject?: string;
|
||||
}
|
||||
|
||||
export interface IAuthenticateAccountOptions {
|
||||
email: string;
|
||||
password: string;
|
||||
authSource?: TIdpAccountAuthSource | 'auto';
|
||||
}
|
||||
|
||||
export interface IAuthenticatedAccountResult {
|
||||
account: IIdpSdkAccount;
|
||||
authSource: TIdpAccountAuthSource;
|
||||
idpJwt?: string;
|
||||
idpRefreshToken?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user