PHP 8.2.30
Preview: default-auth-provider.ts Size: 815 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/backend/utils/auth/default-auth-provider.ts

import { AuthProviderConfig, AuthenticatePayload, BaseAuthProvider, LoginHandlerOptions } from './base-auth-provider.js'

export interface DefaultAuthenticatePayload extends AuthenticatePayload {
  email: string;
  password: string;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultAuthProviderConfig extends AuthProviderConfig<DefaultAuthenticatePayload> {}

export class DefaultAuthProvider extends BaseAuthProvider {
  protected readonly authenticate

  constructor({ authenticate }: DefaultAuthProviderConfig) {
    super()
    this.authenticate = authenticate
  }

  override async handleLogin(opts: LoginHandlerOptions, context) {
    const { data = {} } = opts
    const { email, password } = data

    return this.authenticate({ email, password }, context)
  }
}

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
3.71 KB lrw-r--r-- 2026-02-28 00:32:00
Edit Download
815 B lrw-r--r-- 2026-02-28 00:32:06
Edit Download
83 B lrw-r--r-- 2026-02-28 00:32:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).