@mrhsp/auth-backend
Version:
Gate Keeper Backend Authentication Package
17 lines (16 loc) • 592 B
TypeScript
import { AuthAccount, AuthOptions } from "./interfaces.js";
export declare class AuthService<T extends AuthAccount> {
private adapter;
private jwtSecret;
private jwtOptions;
private passwordPolicy?;
constructor(options: AuthOptions<T>);
register(registrationData: Omit<T, "passwordHash"> & {
password: string;
}): Promise<void>;
authenticate(id: string, password: string): Promise<string>;
resetPassword(id: string, newPassword: string): Promise<void>;
verifyToken(token: string): string;
private hashPassword;
private generateToken;
}