NativeAuthenticationStrategy
NativeAuthenticationStrategy
This strategy implements a username/password credential-based authentication, with the credentials being stored in the Vendure database. This is the default method of authentication, and it is advised to keep it configured unless there is a specific reason not to.
Signature
class NativeAuthenticationStrategy implements AuthenticationStrategy<NativeAuthenticationData> {
readonly readonly name = NATIVE_AUTH_STRATEGY_NAME;
async init(injector: Injector) => ;
defineInputType() => DocumentNode;
async authenticate(ctx: RequestContext, data: NativeAuthenticationData) => Promise<User | false>;
async verifyUserPassword(ctx: RequestContext, userId: ID, password: string) => Promise<boolean>;
}
Implements
- AuthenticationStrategy<NativeAuthenticationData>
Members
name
property
type:
init
method
type:
(injector: Injector) =>
defineInputType
method
type:
() => DocumentNode
authenticate
method
type:
(ctx: RequestContext, data: NativeAuthenticationData) => Promise<User | false>
verifyUserPassword
method
type:
(ctx: RequestContext, userId: ID, password: string) => Promise<boolean>