@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
77 lines (76 loc) • 2.28 kB
TypeScript
import { SDKToken } from '../../models';
export declare class XompassAuth {
private static token;
protected static prefix: string;
/**
* @method setRememberMe
* @param value Flag to remember credentials
* @description
* This method will set a flag in order to remember the current credentials
*/
static setRememberMe(value: boolean): void;
/**
* @method setUser
* @param user Any type of user model
* @description
* This method will update the user information and persist it if the
* rememberMe flag is set.
*/
static setUser(user: any): void;
/**
* @method setToken
* @param token SDKToken or casted AccessToken instance
* @description
* This method will set a flag in order to remember the current credentials
*/
static setToken(token: SDKToken): void;
/**
* @method getToken
* @description
* This method will set a flag in order to remember the current credentials.
*/
static getToken(): SDKToken;
/**
* @method getAccessTokenId
* @description
* This method will return the actual token string, not the object instance.
*/
static getAccessTokenId(): string;
/**
* @method getCurrentUserId
* @description
* This method will return the current user id, it can be number or string.
*/
static getCurrentUserId(): any;
/**
* @method getCurrentUserData
* @description
* This method will return the current user instance.
*/
static getCurrentUserData(): any;
/**
* @method save
* @description
* This method will save in either local storage or cookies the current credentials.
* But only if rememberMe is enabled.
*/
static save(): boolean;
/**
* @method load
* @description
* This method will load either from local storage or cookies the provided property.
*/
static load(): void;
/**
* @method clear
* @description
* This method will clear cookies or the local storage.
*/
static clear(): void;
/**
* @method persist
* @description
* This method saves values to storage
*/
static persist(prop: string, value: any, expires?: Date): void;
}