Skip to content

Commit 8d17c95

Browse files
committed
fix: IdentityServer encoding the state url
1 parent 4c9244f commit 8d17c95

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/app/core/auth.service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ export class AuthService {
150150
// login(...) should never have this, but in case someone ever calls
151151
// initImplicitFlow(undefined | null) this could happen.
152152
if (this.oauthService.state && this.oauthService.state !== 'undefined' && this.oauthService.state !== 'null') {
153-
console.log('There was state, so we are sending you to: ' + this.oauthService.state);
154-
this.router.navigateByUrl(this.oauthService.state);
153+
let stateUrl = this.oauthService.state;
154+
if (stateUrl.startsWith('/') === false) {
155+
stateUrl = decodeURIComponent(stateUrl);
156+
}
157+
console.log(`There was state of ${this.oauthService.state}, so we are sending you to: ${stateUrl}`);
158+
this.router.navigateByUrl(stateUrl);
155159
}
156160
})
157161
.catch(() => this.isDoneLoadingSubject$.next(true));

0 commit comments

Comments
 (0)