From 84762753b93457f70c8e7e82601babd9f955a473 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 27 Jul 2022 16:57:46 +0300 Subject: [PATCH] connect user compoonent: update method to check if user is subscribed, avoiid double messages, make sure it redirects properly after login and subscribe --- login/user.component.html | 2 +- login/user.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/login/user.component.html b/login/user.component.html index cfa09839..732c4faf 100644 --- a/login/user.component.html +++ b/login/user.component.html @@ -52,7 +52,7 @@ -
+
The requested page requires authentication. Please sign in to continue. diff --git a/login/user.component.ts b/login/user.component.ts index acf2b748..d364684f 100644 --- a/login/user.component.ts +++ b/login/user.component.ts @@ -52,7 +52,7 @@ export class UserComponent { this.errorCode = params["errorCode"]; this.redirectUrl = params["redirectUrl"]; this.errorMessage = ""; - if (this.loggedIn && (this.errorCode == '1' || this.errorCode == '3')) { + if (this.loggedIn && (this.errorCode == '1' || this.errorCode == '3' || this.errorCode == '7')) { this.redirect(); } else { this.loading = false; @@ -70,7 +70,11 @@ export class UserComponent { }); } - redirect() { + redirect(redirectUrl = null) { + //if parameters are not read yet, force them to use the function parameter + if(!this.redirectUrl && redirectUrl){ + this.redirectUrl = redirectUrl + } if (this.redirectUrl && this.redirectUrl != "") { this.redirectUrl = decodeURIComponent(this.redirectUrl); this.userManagementsService.setRedirectUrl(this.redirectUrl);