@nephele/authenticator-nymph
Version:
Nymph.js authenticator for the Nephele WebDAV server.
21 lines (20 loc) • 797 B
TypeScript
import type { Request } from 'express';
import type { Nymph } from '@nymphjs/nymph';
import { User as UserClass, type UserData } from '@nymphjs/tilmeld';
import type { Authenticator as AuthenticatorInterface, AuthResponse as NepheleAuthResponse } from 'nephele';
export type AuthenticatorConfig = {
realm?: string;
nymph: Nymph;
};
export type AuthResponse = NepheleAuthResponse<any, {
user: UserClass & UserData;
}>;
export default class Authenticator implements AuthenticatorInterface {
realm: string;
nymph: Nymph;
constructor(config: AuthenticatorConfig);
authenticate(request: Request, response: AuthResponse): Promise<UserClass & UserData & {
username: string;
}>;
cleanAuthentication(_request: Request, _response: AuthResponse): Promise<void>;
}