import { Observable, Subject } from 'rxjs'; import { AuthState } from '../model/AuthState'; import { RegisterProps } from '../model/RegisterProps'; import { IdpProvider } from '../model/IdpProvider'; import { UpdateEmailProps } from "../model/UpdateEmailProps"; export interface BaseAuthService { authState: AuthState; stateChangedObservable?: Subject; /** * Define whether current user is authenticated * this will returns the AuthState once and not meant to be a listener of the authentication state * for AuthState listening, please use listenToStateChanges method */ isAuthenticated(): Observable; /** * Listen to the authentication state changes */ listenToStateChanges(): Observable; /** * To get the access token of the current authenticated user */ getAccessToken(): Observable; register(props: RegisterProps): Promise; login(email: string, password: string): Promise; logout(): Promise; /** * To sent reset password link to their email * @param email */ forgotPassword(email: string): Promise; /** * Reset user pasword * @param email * @param code * @param password */ resetPassword(email: string, code: string, password: string): Promise; /** * Authenticate through other services like google or facebook * @param idpProvider */ authenticateFromExternalIdp(idpProvider: IdpProvider): Promise; /** * Get current authenticated user profile */ getUserProfile(): Promise; /** * Update email of current authenticated user * @param data */ updateEmail(data: UpdateEmailProps): Promise; /** * Verify the updated email * @param data */ verifyUpdateEmail(data: UpdateEmailProps): Promise; /** * Change password * @param old_password * @param new_password */ changePassword(old_password: string, new_password: string): Promise; /** * Change password as admin * @param new_password * @param user_id */ changePasswordAsAdmin(new_password: string, user_id: number): Promise; /** * Verify cognito user registration */ checkIfCognitoUserExist(): Promise; } //# sourceMappingURL=base-auth.service.d.ts.map