Interface MongodbModelAuthProviderContract<User>

interface MongodbModelAuthProviderContract<User extends MongodbModel<unknown>> {
    findById(
        id: string | number,
    ): Promise<ProviderUserContract<InstanceType<User>>>;
    findByRememberMeToken(
        userId: string | number,
        token: string,
    ): Promise<ProviderUserContract<InstanceType<User>>>;
    findByUid(uid: string): Promise<ProviderUserContract<InstanceType<User>>>;
    getUserFor(
        user: InstanceType<User>,
    ): Promise<ProviderUserContract<InstanceType<User>>>;
    updateRememberMeToken(
        authenticatable: ProviderUserContract<InstanceType<User>>,
    ): Promise<void>;
}

Type Parameters

Hierarchy

  • UserProviderContract<InstanceType<User>>
    • MongodbModelAuthProviderContract

Methods

  • Find a user using the primary key value

    Parameters

    • id: string | number

    Returns Promise<ProviderUserContract<InstanceType<User>>>

  • Find a user using the remember me token

    Parameters

    • userId: string | number
    • token: string

    Returns Promise<ProviderUserContract<InstanceType<User>>>

  • Find a user by searching for their uids

    Parameters

    • uid: string

    Returns Promise<ProviderUserContract<InstanceType<User>>>

  • Return an instance of the user wrapped inside the Provider user contract

    Parameters

    • user: InstanceType<User>

    Returns Promise<ProviderUserContract<InstanceType<User>>>

  • Update remember token

    Parameters

    • authenticatable: ProviderUserContract<InstanceType<User>>

    Returns Promise<void>