-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
486 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Node generated files | ||
node_modules | ||
npm-debug.log | ||
# OS generated files | ||
|
||
Thumbs.db | ||
.DS_Store | ||
.DS_Store | ||
|
||
*.js | ||
*.map | ||
*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,59 @@ | ||
export * from './src/angular2-jwt'; | ||
import { Http, RequestMethod, Response } from 'angular2/http'; | ||
import { Observable } from 'rxjs/Observable'; | ||
export interface IAuthConfig { | ||
headerName: string; | ||
headerPrefix: string; | ||
tokenName: string; | ||
tokenGetter: any; | ||
noJwtError: boolean; | ||
} | ||
/** | ||
* Sets up the authentication configuration. | ||
*/ | ||
export declare class AuthConfig { | ||
config: any; | ||
headerName: string; | ||
headerPrefix: string; | ||
tokenName: string; | ||
tokenGetter: any; | ||
noJwtError: boolean; | ||
constructor(config?: any); | ||
getConfig(): { | ||
headerName: string; | ||
headerPrefix: string; | ||
tokenName: string; | ||
tokenGetter: any; | ||
noJwtError: boolean; | ||
}; | ||
} | ||
/** | ||
* Allows for explicit authenticated HTTP requests. | ||
*/ | ||
export declare class AuthHttp { | ||
private _config; | ||
tokenStream: Observable<string>; | ||
http: Http; | ||
constructor(config?: Object); | ||
request(method: RequestMethod, url: string, body?: string): Observable<Response>; | ||
get(url: string): Observable<Response>; | ||
post(url: string, body: string): Observable<Response>; | ||
put(url: string, body: string): Observable<Response>; | ||
delete(url: string, body?: string): Observable<Response>; | ||
options(url: string, body?: string): Observable<Response>; | ||
head(url: string, body?: string): Observable<Response>; | ||
patch(url: string, body: string): Observable<Response>; | ||
} | ||
/** | ||
* Helper class to decode and find JWT expiration. | ||
*/ | ||
export declare class JwtHelper { | ||
urlBase64Decode(str: string): string; | ||
decodeToken(token: string): any; | ||
getTokenExpirationDate(token: string): Date; | ||
isTokenExpired(token: string, offsetSeconds?: number): boolean; | ||
} | ||
/** | ||
* Checks for presence of token and that token hasn't expired. | ||
* For use with the @CanActivate router decorator and NgIf | ||
*/ | ||
export declare function tokenNotExpired(tokenName?: string, jwt?: string): boolean; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.