🚨 Announcing Vendure v2 Beta

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

Members

name

readonly property
type:

init

async method
type:
(injector: Injector) =>

defineInputType

method
type:
() => DocumentNode

authenticate

async method
type:
(ctx: RequestContext, data: NativeAuthenticationData) => Promise<User | false>

verifyUserPassword

async method
type:
(ctx: RequestContext, userId: ID, password: string) => Promise<boolean>