Interface MongodbModelAuthProviderConfig<User>

interface MongodbModelAuthProviderConfig {
    driver: "mongodb-model";
    hashDriver?: "bcrypt";
    identifierKey?: Exclude<keyof InstanceType<User>, "id" | Extract<keyof InstanceType<User>, `$${string}`> | FunctionProperties<Omit<InstanceType<User>, Extract<keyof InstanceType<User>, `$${string}`>>>>;
    identifierKeyType?: "string" | "number" | "objectid";
    model?: (() => Promise<User> | Promise<{
        default: User;
    }>);
    uids?: Exclude<keyof InstanceType<User>, "id" | Extract<keyof InstanceType<User>, `$${string}`> | FunctionProperties<Omit<InstanceType<User>, Extract<keyof InstanceType<User>, `$${string}`>>>>[];
}

Type Parameters

Properties

driver: "mongodb-model"
hashDriver?: "bcrypt"

Hash driver used to hash the password.

identifierKey?: Exclude<keyof InstanceType<User>, "id" | Extract<keyof InstanceType<User>, `$${string}`> | FunctionProperties<Omit<InstanceType<User>, Extract<keyof InstanceType<User>, `$${string}`>>>>

Unique key on the user object.

Default

_id
identifierKeyType?: "string" | "number" | "objectid"

Value type for identifierKey.

Default

'objectid'
model?: (() => Promise<User> | Promise<{
    default: User;
}>)

Type declaration

    • (): Promise<User> | Promise<{
          default: User;
      }>
    • Function that imports the user model.

      Returns Promise<User> | Promise<{
          default: User;
      }>

      Default

      () => import('App/Models/User')
      
uids?: Exclude<keyof InstanceType<User>, "id" | Extract<keyof InstanceType<User>, `$${string}`> | FunctionProperties<Omit<InstanceType<User>, Extract<keyof InstanceType<User>, `$${string}`>>>>[]

List of keys used to search the user.

Default

['email']