@auth0/angular-jwt
Advanced tools
Comparing version 5.1.1 to 5.1.2
@@ -90,8 +90,7 @@ (function (global, factory) { | ||
var _this = this; | ||
if (token === void 0) { token = null; } | ||
var _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(function (t) { return _this._decodeToken(t); }); | ||
if (token === void 0) { token = this.tokenGetter(); } | ||
if (token instanceof Promise) { | ||
return token.then(function (t) { return _this._decodeToken(t); }); | ||
} | ||
return this._decodeToken(_token); | ||
return this._decodeToken(token); | ||
}; | ||
@@ -114,8 +113,7 @@ JwtHelperService.prototype._decodeToken = function (token) { | ||
var _this = this; | ||
if (token === void 0) { token = null; } | ||
var _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(function (t) { return _this._getTokenExpirationDate(t); }); | ||
if (token === void 0) { token = this.tokenGetter(); } | ||
if (token instanceof Promise) { | ||
return token.then(function (t) { return _this._getTokenExpirationDate(t); }); | ||
} | ||
return this._getTokenExpirationDate(_token); | ||
return this._getTokenExpirationDate(token); | ||
}; | ||
@@ -134,8 +132,7 @@ JwtHelperService.prototype._getTokenExpirationDate = function (token) { | ||
var _this = this; | ||
if (token === void 0) { token = null; } | ||
var _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(function (t) { return _this._isTokenExpired(t, offsetSeconds); }); | ||
if (token === void 0) { token = this.tokenGetter(); } | ||
if (token instanceof Promise) { | ||
return token.then(function (t) { return _this._isTokenExpired(t, offsetSeconds); }); | ||
} | ||
return this._isTokenExpired(_token, offsetSeconds); | ||
return this._isTokenExpired(token, offsetSeconds); | ||
}; | ||
@@ -142,0 +139,0 @@ JwtHelperService.prototype._isTokenExpired = function (token, offsetSeconds) { |
# Change Log | ||
## [v5.1.2](https://github.com/auth0/angular2-jwt/tree/v5.1.2) (2022-12-20) | ||
[Full Changelog](https://github.com/auth0/angular2-jwt/compare/v5.1.1...v5.1.2) | ||
**Fixed** | ||
- Restore pre 5.1.1 behavior and fix types [\#759](https://github.com/auth0/angular2-jwt/pull/759) ([frederikprijck](https://github.com/frederikprijck)) | ||
## [v5.1.1](https://github.com/auth0/angular2-jwt/tree/v5.1.1) (2022-12-15) | ||
@@ -4,0 +10,0 @@ [Full Changelog](https://github.com/auth0/angular2-jwt/compare/v5.1.0...v5.1.1) |
@@ -62,8 +62,7 @@ // tslint:disable:no-bitwise | ||
} | ||
decodeToken(token = null) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._decodeToken(t)); | ||
decodeToken(token = this.tokenGetter()) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._decodeToken(t)); | ||
} | ||
return this._decodeToken(_token); | ||
return this._decodeToken(token); | ||
} | ||
@@ -84,8 +83,7 @@ _decodeToken(token) { | ||
} | ||
getTokenExpirationDate(token = null) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._getTokenExpirationDate(t)); | ||
getTokenExpirationDate(token = this.tokenGetter()) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._getTokenExpirationDate(t)); | ||
} | ||
return this._getTokenExpirationDate(_token); | ||
return this._getTokenExpirationDate(token); | ||
} | ||
@@ -102,8 +100,7 @@ _getTokenExpirationDate(token) { | ||
} | ||
isTokenExpired(token = null, offsetSeconds) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._isTokenExpired(t, offsetSeconds)); | ||
isTokenExpired(token = this.tokenGetter(), offsetSeconds) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._isTokenExpired(t, offsetSeconds)); | ||
} | ||
return this._isTokenExpired(_token, offsetSeconds); | ||
return this._isTokenExpired(token, offsetSeconds); | ||
} | ||
@@ -136,2 +133,2 @@ _isTokenExpired(token, offsetSeconds) { | ||
}] }]; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiand0aGVscGVyLnNlcnZpY2UuanMi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+68,7 @@ import * as i0 from '@angular/core'; | ||
} | ||
decodeToken(token = null) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._decodeToken(t)); | ||
decodeToken(token = this.tokenGetter()) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._decodeToken(t)); | ||
} | ||
return this._decodeToken(_token); | ||
return this._decodeToken(token); | ||
} | ||
@@ -90,8 +89,7 @@ _decodeToken(token) { | ||
} | ||
getTokenExpirationDate(token = null) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._getTokenExpirationDate(t)); | ||
getTokenExpirationDate(token = this.tokenGetter()) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._getTokenExpirationDate(t)); | ||
} | ||
return this._getTokenExpirationDate(_token); | ||
return this._getTokenExpirationDate(token); | ||
} | ||
@@ -108,8 +106,7 @@ _getTokenExpirationDate(token) { | ||
} | ||
isTokenExpired(token = null, offsetSeconds) { | ||
const _token = token || this.tokenGetter(); | ||
if (_token instanceof Promise) { | ||
return _token.then(t => this._isTokenExpired(t, offsetSeconds)); | ||
isTokenExpired(token = this.tokenGetter(), offsetSeconds) { | ||
if (token instanceof Promise) { | ||
return token.then(t => this._isTokenExpired(t, offsetSeconds)); | ||
} | ||
return this._isTokenExpired(_token, offsetSeconds); | ||
return this._isTokenExpired(token, offsetSeconds); | ||
} | ||
@@ -116,0 +113,0 @@ _isTokenExpired(token, offsetSeconds) { |
@@ -9,11 +9,17 @@ import { HttpRequest } from '@angular/common/http'; | ||
private b64DecodeUnicode; | ||
decodeToken<T = any>(token?: string): T | Promise<T>; | ||
decodeToken<T = any>(token: string): T | null; | ||
decodeToken<T = any>(token: Promise<string>): Promise<T | null>; | ||
decodeToken<T = any>(): null | T | Promise<T | null>; | ||
private _decodeToken; | ||
getTokenExpirationDate(token?: string): Date | null | Promise<Date>; | ||
getTokenExpirationDate(token: string): Date | null; | ||
getTokenExpirationDate(token: Promise<string>): Promise<Date | null>; | ||
getTokenExpirationDate(): null | Date | Promise<Date | null>; | ||
private _getTokenExpirationDate; | ||
isTokenExpired(token?: string, offsetSeconds?: number): boolean | Promise<boolean>; | ||
_isTokenExpired(token: string, offsetSeconds?: number): boolean; | ||
getAuthScheme(authScheme: Function | string | undefined, request: HttpRequest<any>): string; | ||
isTokenExpired(token?: undefined, offsetSeconds?: number): boolean | Promise<boolean>; | ||
isTokenExpired(token: string | null, offsetSeconds?: number): boolean; | ||
isTokenExpired(token: Promise<string>, offsetSeconds?: number): Promise<boolean>; | ||
private _isTokenExpired; | ||
getAuthScheme(authScheme: Function | string | undefined, request: HttpRequest<any>): string | undefined; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<JwtHelperService, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<JwtHelperService>; | ||
} |
{ | ||
"name": "@auth0/angular-jwt", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"description": "JSON Web Token helper library for Angular", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128767
947