@@ -85,7 +85,10 @@ Configuration options can be passed as `Angular2TokenOptions` via `.init()`.
85
85
constructor(private _tokenService: Angular2TokenService) {
86
86
this._tokenService.init({
87
87
apiPath: null,
88
+
88
89
signInPath: ' auth/sign_in' ,
90
+ signInRedirect: null,
91
+
89
92
signOutPath: ' auth/sign_out' ,
90
93
validateTokenPath: ' auth/validate_token' ,
91
94
@@ -106,6 +109,7 @@ constructor(private _tokenService: Angular2TokenService) {
106
109
| ----------------------------------- | ----------------------------------------------- |
107
110
| ` apiPath? : string` | Sets base path all operations are based on |
108
111
| ` signInPath? : string` | Sets path for sign in |
112
+ | ` signInRedirect? : string` | Sets redirect path for failed CanActivate |
109
113
| ` signOutPath? : string` | Sets path for sign out |
110
114
| ` validateTokenPath? : string` | Sets path for token validation |
111
115
| ` registerAccountPath? : string` | Sets path for account registration |
@@ -285,8 +289,9 @@ this._tokenService.currentUser; // ADMIN
285
289
` ` `
286
290
287
291
# # Route Guards
288
- Angular2-Token implements the ` CanActivate` interface, so it can directly be used
289
- as a route guard. It currently does not distinguish between user types.
292
+ Angular2-Token implements the ` CanActivate` interface, so it can directly be used as a route guard.
293
+ If the ` signInRedirect` option is set the user will be redirected on a failed (=false) CanActivate using ` Router.navigate()` .
294
+ It currently does not distinguish between user types.
290
295
291
296
# ### Example:
292
297
` ` ` javascript
0 commit comments