UNPKG

login-auth-services

Version:

Authentication services for Google, GitHub, Microsoft, okta and multi-factor authentication using OTP.

18 lines (17 loc) 822 B
import type { User } from "../entities/User"; export declare const hashPassword: (password: string, saltRounds?: number) => Promise<string>; export declare const validatePassword: (password: string, hashedPassword: string) => Promise<boolean>; export declare const generateToken: (userId: string | number, email: string) => string; export declare const registerUser: (username: string, email: string, password: string) => Promise<User>; export declare const loginUser: (email: string, password: string) => Promise<{ user: User; token: string; } | null>; export declare const initiateLoginWithEmail: (email: string) => Promise<{ message: string; success: boolean; }>; export declare const validateOTP: (email: string, otp: string) => Promise<{ user: User; token: string; } | null>;