From fc326a3d30ad8879797860716b405606111b1e4d Mon Sep 17 00:00:00 2001 From: futa-ikeda Date: Fri, 14 Nov 2025 14:57:37 -0500 Subject: [PATCH] feat(login): Add next param to login URL redirect --- src/app/core/services/auth.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/core/services/auth.service.ts b/src/app/core/services/auth.service.ts index c07b1e10d..871fa81b5 100644 --- a/src/app/core/services/auth.service.ts +++ b/src/app/core/services/auth.service.ts @@ -35,14 +35,15 @@ export class AuthService { navigateToSignIn(): void { this.loaderService.show(); - const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login` })}`; + const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login`, next: window.location.href })}`; window.location.href = loginUrl; } navigateToOrcidSignIn(): void { const loginUrl = `${this.casUrl}/login?${urlParam({ redirectOrcid: 'true', - service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`, + service: `${this.webUrl}/login`, + next: window.location.href, })}`; window.location.href = loginUrl; } @@ -50,7 +51,8 @@ export class AuthService { navigateToInstitutionSignIn(): void { const loginUrl = `${this.casUrl}/login?${urlParam({ campaign: 'institution', - service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`, + service: `${this.webUrl}/login`, + next: window.location.href, })}`; window.location.href = loginUrl; }