@hz-9/a5-authn
Version:
Authentication module for the @hz-9/a5-* series of repositories.
21 lines (20 loc) • 646 B
TypeScript
import { A5AuthTokenPairBo, A5AuthnUserPayloadBo } from '../../interfaces/auth';
export interface A5AuthnPwdService {
/**
*
* 基于用户 Payload,获取用户 Token.
*
* @param user - 用户 Payload
*/
getTokens(user: A5AuthnUserPayloadBo): Promise<A5AuthTokenPairBo>;
/**
*
* 基于用户名密码,获取用户 Payload.
*
* 如果状态异常,可直接在函数中抛错,如果返回 null 则表示用户不存在
*
* @param username
* @param password
*/
validateCredentials(username: string, password: string): Promise<A5AuthnUserPayloadBo | null>;
}