Documentation
    Preparing search index...

    Authentication adapter implementing the PocketBase backend logic. Exposes login, registration, and token management via the official pocketbase JS SDK.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _alias: string = ''
    _client: Client
    _params: AuthParameters = {}
    UserClass: typeof User = User

    The User class reference to be used by the adapter.

    Accessors

    • get alias(): string

      Returns string

    • set alias(alias: string): void

      Parameters

      • alias: string

      Returns void

    Methods

    • Destroys a PocketBase user record.

      Parameters

      • user: User

        Target user.

      Returns Promise<any>

    • Validates and returns user session context from a raw JWT via the PocketBase SDK.

      Parameters

      • token: string

        The raw authentication token.

      Returns Promise<any>

      The associated user record.

    • Returns the pluggable endpoint handler function for this adapter, if any.

      Returns any

      The EndpointHandler callback or null.

    • Initiates password recovery/reset process for a user.

      Parameters

      • email: string

        The user email.

      • OptionalredirectTo: string

        Optional redirect destination.

      Returns Promise<any>

    • Attempts to renew the SDK auth token via a refresh flow.

      Parameters

      • refreshToken: string

        The refresh token.

      Returns Promise<any>

      An object containing the new access token.

    • Registers a new user directly in PocketBase.

      Parameters

      • user: User

        Target user entity.

      • OptionalclearPassword: string

        The plaintext password string.

      Returns Promise<any>

      The created user record.

      If registration fails.

    • Clears the current stored context mapping to the given token.

      Parameters

      • token: string

        The token to revoke.

      Returns Promise<any>

    • Modifies metadata claims mapped to the internal user_metadata field.

      Parameters

      • id: string

        The user ID.

      • claims: any

        The payload to store.

      Returns Promise<any>

    • Discards the active local SDK authentication store.

      Parameters

      • Optionaluser: User

        Target user.

      Returns Promise<any>

    • Authenticates a user against PocketBase via email and password.

      Parameters

      • login: string

        Login identifier.

      • password: string

        Plaintext password.

      Returns Promise<any>

      The authenticated session wrapper containing user state and the JWT token.

    • Modifies a PocketBase user collection record.

      Parameters

      • user: User

        Target user.

      • updatable: any

        Property patches.

      Returns Promise<any>