File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ this.sendHttpRequest(new RequestOptions({
268268# # Multiple User Types
269269An array of ` UserType` can be passed in ` Angular2TokenOptions` during ` init()` .
270270The user type is selected during sign in and persists until sign out.
271- ` .currentUser ` returns the currently logged in user.
271+ ` .currentUserType ` returns the currently logged in user.
272272
273273# ### Example:
274274` ` ` javascript
@@ -285,7 +285,7 @@ this._tokenService.signIn(
285285 ' ADMIN'
286286)
287287
288- this._tokenService.currentUser ; // ADMIN
288+ this._tokenService.currentUserType ; // ADMIN
289289` ` `
290290
291291# # Route Guards
Original file line number Diff line number Diff line change 1- export interface UserType {
2- name : string ;
3- path : string ;
4- }
5-
61export interface AuthData {
72 accessToken : string ;
83 client : string ;
@@ -11,8 +6,25 @@ export interface AuthData {
116 uid : string ;
127}
138
9+ export interface UserData {
10+ id : number ;
11+ provider : string ;
12+ uid : string ;
13+ name : string ;
14+ nickname : string ;
15+ image : any ;
16+ email : string ;
17+ }
18+
19+ // Configuration Options
20+
21+ export interface UserType {
22+ name : string ;
23+ path : string ;
24+ }
25+
1426export interface OAuthPaths {
15- github ?: string ;
27+ github ?: string ;
1628}
1729
1830export interface Angular2TokenOptions {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import 'rxjs/add/operator/share';
1414
1515import {
1616 UserType ,
17+ UserData ,
1718 AuthData ,
1819 Angular2TokenOptions
1920} from './angular2-token.model' ;
@@ -28,14 +29,14 @@ export class Angular2TokenService implements CanActivate {
2829 return null ;
2930 }
3031
31- get currentUserData ( ) : string {
32+ get currentUserData ( ) : UserData {
3233 return this . _currentUserData ;
3334 }
3435
3536 private _options : Angular2TokenOptions ;
3637 private _currentUserType : UserType ;
3738 private _currentAuthData : AuthData ;
38- private _currentUserData : any ;
39+ private _currentUserData : UserData ;
3940
4041 constructor (
4142 private _http : Http ,
You can’t perform that action at this time.
0 commit comments