feat(server): remove phone number from authentication process

This commit is contained in:
a.bouhuolia
2023-04-05 04:18:12 +02:00
parent da20b7c837
commit 961ff74880
14 changed files with 496 additions and 414 deletions

View File

@@ -1,29 +1,77 @@
import { ISystemUser } from './User';
import { ITenant } from './Tenancy';
import { SystemUser } from '@/system/models';
export interface IRegisterDTO {
firstName: string,
lastName: string,
email: string,
password: string,
organizationName: string,
};
firstName: string;
lastName: string;
email: string;
password: string;
organizationName: string;
}
export interface ILoginDTO {
crediential: string,
password: string,
};
crediential: string;
password: string;
}
export interface IPasswordReset {
id: number,
email: string,
token: string,
createdAt: Date,
};
id: number;
email: string;
token: string;
createdAt: Date;
}
export interface IAuthenticationService {
signIn(emailOrPhone: string, password: string): Promise<{ user: ISystemUser, token: string, tenant: ITenant }>;
signIn(
email: string,
password: string
): Promise<{ user: ISystemUser; token: string; tenant: ITenant }>;
register(registerDTO: IRegisterDTO): Promise<ISystemUser>;
sendResetPassword(email: string): Promise<IPasswordReset>;
resetPassword(token: string, password: string): Promise<void>;
}
export interface IAuthSigningInEventPayload {
email: string;
password: string;
user: ISystemUser;
}
export interface IAuthSignedInEventPayload {
email: string;
password: string;
user: ISystemUser;
}
export interface IAuthSigningUpEventPayload {
signupDTO: IRegisterDTO;
}
export interface IAuthSignedUpEventPayload {
signupDTO: IRegisterDTO;
tenant: ITenant;
user: ISystemUser;
}
export interface IAuthSignInPOJO {
user: ISystemUser;
token: string;
tenant: ITenant;
}
export interface IAuthResetedPasswordEventPayload {
user: SystemUser;
token: string;
password: string;
}
export interface IAuthSendingResetPassword {
user: ISystemUser,
token: string;
}
export interface IAuthSendedResetPassword {
user: ISystemUser,
token: string;
}