mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Merge remote-tracking branch 'upstream/master' into types2.0
Add tsconfig files everywhere # Conflicts: # azure-mobile-services-client/AzureMobileServicesClient.d.ts # bookshelf/bookshelf.d.ts # hapi/hapi.d.ts # helmet/helmet.d.ts # mongodb/mongodb.d.ts # nock/nock.d.ts # react-bootstrap/react-bootstrap.d.ts # react-helmet/react-helmet.d.ts # restify/restify.d.ts # sequelize/sequelize.d.ts
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
|
||||
var app = angular.module("angular-jwt-tests", ["angular-jwt"]);
|
||||
|
||||
var $jwtHelper: angular.jwt.IJwtHelper;
|
||||
var $jwtHelper: ng.jwt.IJwtHelper;
|
||||
|
||||
var expToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NhbXBsZXMuYXV0aDAuY29tLyIsInN1YiI6ImZhY2Vib29rfDEwMTU0Mjg3MDI3NTEwMzAyIiwiYXVkIjoiQlVJSlNXOXg2MHNJSEJ3OEtkOUVtQ2JqOGVESUZ4REMiLCJleHAiOjE0MTIyMzQ3MzAsImlhdCI6MTQxMjE5ODczMH0.7M5sAV50fF1-_h9qVbdSgqAnXVF7mz3I6RjS6JiH0H8';
|
||||
var tokenPayload = $jwtHelper.decodeToken(expToken);
|
||||
var date = $jwtHelper.getTokenExpirationDate(expToken);
|
||||
var bool = $jwtHelper.isTokenExpired(expToken);
|
||||
|
||||
var $jwtInterceptor: angular.jwt.IJwtInterceptor;
|
||||
var $jwtInterceptor: ng.jwt.IJwtInterceptor;
|
||||
|
||||
$jwtInterceptor.tokenGetter = () => {
|
||||
return expToken;
|
||||
|
||||
16
angular-jwt/angular-jwt.d.ts
vendored
16
angular-jwt/angular-jwt.d.ts
vendored
@@ -8,14 +8,14 @@
|
||||
declare namespace angular.jwt {
|
||||
|
||||
interface JwtToken {
|
||||
iss: string;
|
||||
sub: string;
|
||||
aud: string;
|
||||
exp: number;
|
||||
nbf: number;
|
||||
iat: number;
|
||||
jti: string;
|
||||
unique_name: string;
|
||||
iss?: string;
|
||||
sub?: string;
|
||||
aud?: string;
|
||||
exp?: number;
|
||||
nbf?: number;
|
||||
iat?: number;
|
||||
jti?: string;
|
||||
unique_name?: string;
|
||||
}
|
||||
|
||||
interface IJwtHelper {
|
||||
|
||||
9
angular-jwt/tsconfig.json
Normal file
9
angular-jwt/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user