This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 505606cd authored by Daniel Crazzolara's avatar Daniel Crazzolara
Browse files

trying to fix redirect with timeout

parent 1e18e431
2 merge requests!62created achievementService and separated some functionality out of...,!61Feature/#51 import from artemis
...@@ -88,10 +88,12 @@ export class AccountService { ...@@ -88,10 +88,12 @@ export class AccountService {
private navigateToStoredUrl(): void { private navigateToStoredUrl(): void {
// previousState can be set in the authExpiredInterceptor and in the userRouteAccessService // previousState can be set in the authExpiredInterceptor and in the userRouteAccessService
// if login is successful, go to stored previousState and clear previousState // if login is successful, go to stored previousState and clear previousState
const previousUrl = String(this.stateStorageService.getUrl()); const previousUrl = this.stateStorageService.getUrl();
if (previousUrl) { if (previousUrl) {
this.router.navigateByUrl(previousUrl).then(() => { this.router.navigateByUrl(previousUrl).then(() => {
this.stateStorageService.clearUrl(); setTimeout(() => {
this.stateStorageService.clearUrl();
}, 10000); // Remove perviousUrl after 10s, because a race condition seems to avoid the redirect
}); });
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment