Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public loggedIn(): boolean {
if (this.runMode === 'DEMO') {
return true;
} else {
let tokenExpired: boolean = true;
try {
tokenExpired = tokenNotExpired('unfetterUiToken');
} catch (e) { }
return tokenExpired && this.getUser() !== null && this.getUser().approved === true && !this.getUser().locked;
}
}
loggedIn() {
let result: boolean;
result = tokenNotExpired("id_token");
if(!result){
return false;
}
return result;
}
}
isLoggedIn() {
if (!tokenNotExpired()) {
localStorage.clear();
}
return tokenNotExpired();
}
}
loggedIn() {
return tokenNotExpired();
}
}
loggedIn() {
return tokenNotExpired();
}
}
loggedIn() {
return tokenNotExpired();
}
}
loggedIn() {
return tokenNotExpired();
}
}
loggedIn() {
return tokenNotExpired();
}
}
static create(http: Http, options: RequestOptions) {
const tokenGetter = () => localStorage.getItem('token');
return new AuthHttp(new AuthConfig({
headerName: 'Authorization',
headerPrefix: 'JWT',
tokenName: 'token',
tokenGetter: tokenGetter,
globalHeaders: [{ 'Content-Type': 'application/json' }],
noJwtError: true,
noTokenScheme: true
}), http, options);
}
}
static create(http: Http, options: RequestOptions) {
const tokenGetter = () => localStorage.getItem('token');
return new AuthHttp(new AuthConfig({
headerName: 'Authorization',
headerPrefix: 'JWT',
tokenName: 'token',
tokenGetter: tokenGetter,
globalHeaders: [{ 'Content-Type': 'application/json' }],
noJwtError: true,
noTokenScheme: true
}), http, options);
}
}