@adonisjs/auth
Version:
Official authentication provider for Adonis framework
35 lines (34 loc) • 1.14 kB
TypeScript
import { SessionGuardConfig, GuardClientContract, UserProviderContract, ProviderUserContract } from '@ioc:Adonis/Addons/Auth';
/**
* Session client to login a user during tests using the
* sessions guard
*/
export declare class SessionClient implements GuardClientContract<any> {
name: string;
private config;
private provider;
constructor(name: string, config: SessionGuardConfig<any>, provider: UserProviderContract<any>);
/**
* The name of the session key name
*/
get sessionKeyName(): string;
/**
* Returns the provider user instance from the regular user details. Raises
* exception when id is missing
*/
protected getUserForLogin(user: any, identifierKey: string): Promise<ProviderUserContract<any>>;
/**
* Returns the request data to mark user as logged in
*/
login(user: any): Promise<{
session: {
[x: string]: string | number;
};
}>;
/**
* No need to logout when using session client.
* Session data is persisted within memory and will
* be cleared after each test
*/
logout(): Promise<void>;
}