Interface MongodbModelAuthProviderConfig<User>

interface MongodbModelAuthProviderConfig<User extends MongodbModel<unknown>> {
    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.

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

Value type for identifierKey.

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

Function that imports the user model.

() => 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.

['email']