UNPKG

@streambird/streambird-js

Version:
38 lines (37 loc) 1.24 kB
import { Session } from '../models'; import { AbstractService } from './abstract-service'; export declare type SessionVerifyRequest = { /** * Time in minutes. Extend the session expiration time to N minutes from now, must be between 5 to 525600 minutes (365 days). */ sessionExpiresIn?: number; }; export declare type SessionVerifyResponse = { sessionToken: string; sessionJwt: string; session: Session; }; export declare type DeleteSessionResponse = { message: string; }; export declare class SessionService extends AbstractService { url: string; /** * Delete an identity session in an App. * @returns successful message */ delete(): Promise<DeleteSessionResponse>; /** * Verify identity Session in an application by session token and/or optionally extend the * expiration time of the Session by N minutes from now if the session_expires_in property * is present. Session token required. * * @returns updated session data */ verify(body?: SessionVerifyRequest): Promise<SessionVerifyResponse>; /** * Check if the session is still valid * @returns if the session is still valid or not */ isLoggedIn(): Promise<boolean>; }