Skip to content

Commit 0cb980d

Browse files
authored
Merge pull request #769 from futa-ikeda/feature/login-url
[ENG-9167] Add next param to login URL redirect
2 parents a0f62f9 + fc326a3 commit 0cb980d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/core/services/auth.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ export class AuthService {
3535

3636
navigateToSignIn(): void {
3737
this.loaderService.show();
38-
const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login` })}`;
38+
const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login`, next: window.location.href })}`;
3939
window.location.href = loginUrl;
4040
}
4141

4242
navigateToOrcidSignIn(): void {
4343
const loginUrl = `${this.casUrl}/login?${urlParam({
4444
redirectOrcid: 'true',
45-
service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`,
45+
service: `${this.webUrl}/login`,
46+
next: window.location.href,
4647
})}`;
4748
window.location.href = loginUrl;
4849
}
4950

5051
navigateToInstitutionSignIn(): void {
5152
const loginUrl = `${this.casUrl}/login?${urlParam({
5253
campaign: 'institution',
53-
service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`,
54+
service: `${this.webUrl}/login`,
55+
next: window.location.href,
5456
})}`;
5557
window.location.href = loginUrl;
5658
}

0 commit comments

Comments
 (0)