userSession

This is the class that is exposed by Appframe on af.userSession.

Require 2-factor authentication

If you are going to use an API that requires 2-factor authentication, you can run af.userSession.expired(undefined, "RequireTwoFactor"), to open a login dialog for 2-factor authentication.

API

import { Handler } from "mitt";

declare type SessionHandlerEvent = "onExpired" | "onAuthenticated";

export default class SessionHandler {
    private eventHandler;
    authenticated(): void;
    expired(callback?: (() => void), type?: "RequireTwoFactor"): Promise<void>;
    attachEvent(eventName: SessionHandlerEvent, handler: Handler): void;
    detachEvent(eventName: SessionHandlerEvent, handler: Handler): void;
}

export declare class UserSession extends SessionHandler {
    amDesignator: string;
    dayNames: string[];
    dayNamesShort: string[];
    decimalSeparator: string;
    domain: string;
    email: string | null | undefined;
    formats: undefined | Record<string, string>;
    groupSeparator: string | null;
    integratedSecurity: boolean;
    isDeveloper: boolean;
    login: string;
    loginType: string | undefined;
    monthNames: string[];
    monthNamesShort: string[];
    name: string | undefined;
    pmDesignator: string;
    shortDateFormat: string;
    culture: string;
    uiculture: string;
    constructor(userData: any);
}

Last updated

Was this helpful?