session-expiration-alert
Version:
An Angular module to time session expiration. When user session idle time reaches a threshold, then pop up a modal dialog to let user choose to continue session or log out the system. When user session is expired, timer will stop and user will be logged o
36 lines (35 loc) • 1.58 kB
TypeScript
import { ElementRef, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { SessionInterruptService } from '../../services/session-interrupt.service';
import { SessionTimerService } from '../../services/session-timer.service';
import * as i0 from "@angular/core";
export declare class SessionExpirationAlertComponent implements OnInit, OnChanges, OnDestroy {
private el;
private sessionInterrupter;
sessionTimer: SessionTimerService;
/**
* Should start the timer or not. Usually, you can set it to true if a user is authenticated.
*/
startTimer?: boolean | undefined;
/**
* Count down seconds.
*/
alertAt?: number | undefined;
showModal: boolean;
expired: boolean;
private sessionTimerSubscription;
constructor(el: ElementRef, sessionInterrupter: SessionInterruptService, sessionTimer: SessionTimerService);
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
private trackSessionTime;
continue(): void;
logout(): void;
open(): void;
close(): void;
cleanUp(): void;
reload(): void;
ngOnDestroy(): void;
handleTabKey(e: KeyboardEvent): void;
handleShiftTabKey(e: KeyboardEvent): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SessionExpirationAlertComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SessionExpirationAlertComponent, "session-expiration-alert", never, { "startTimer": { "alias": "startTimer"; "required": false; }; "alertAt": { "alias": "alertAt"; "required": false; }; }, {}, never, never, false, never>;
}