Skip to content

[ENG-10702] Update connectOrcid to properly logging user out#934

Merged
futa-ikeda merged 1 commit intoCenterForOpenScience:feature/orcid-integrationfrom
futa-ikeda:orcid-signout
Apr 3, 2026
Merged

[ENG-10702] Update connectOrcid to properly logging user out#934
futa-ikeda merged 1 commit intoCenterForOpenScience:feature/orcid-integrationfrom
futa-ikeda:orcid-signout

Conversation

@futa-ikeda
Copy link
Copy Markdown
Contributor

  • Ticket: [ENG-10702]
  • Feature flag: n/a

Purpose

  • Prevent bug that makes it look like two users can connect to the same ORCID account

Summary of Changes

  • Properly sign users out of account before redirecting to ORCID login flow
    • Add new optional parameter to AuthService.logout to specify next query-param

Screenshot(s)

  • NA

Side Effects

QA Notes

@futa-ikeda futa-ikeda merged commit 6b5bf7e into CenterForOpenScience:feature/orcid-integration Apr 3, 2026
3 checks passed
@futa-ikeda futa-ikeda deleted the orcid-signout branch April 3, 2026 16:34
Comment on lines -88 to +90
const logoutUrl = new URL(`${webUrl}/logout/`);
logoutUrl.searchParams.set('next', casLoginUrl.toString());
window.location.href = logoutUrl.toString();
this.authService.logout(casLoginUrl.toString());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix. Just make sure that I understand: this.authService.logout() log user out of angular, BE and CAS?

  1. log out of angular FE session
  2. log our of BE session
  3. the BE logout process in 2 automatically handle CAS logout too

if (isPlatformBrowser(this.platformId)) {
this.cookieService.deleteAll();
window.location.href = `${this.webUrl}/logout/?next=${encodeURIComponent('/')}`;
window.location.href = `${this.webUrl}/logout/?next=${encodeURIComponent(nextUrl || '/')}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed this. The BE logout endpoint will redirect to CAS logout endpoint automatically, so this should work and answers my previous question.

futa-ikeda added a commit that referenced this pull request Apr 8, 2026
* feat(profile-settings): Add query-param to specify a tab (#906)

* [ENG-10584][ENG-10585] Allow users to disconnect existing orcid in social tab (#912)

* feat(settings): Allow users to disconnect orcid in social tab

* feat(settings): Add dummy connect button when no orcid is associated with user

* chore(settings): move authenticated identity to own component

* refactor(settings): Implement CR suggestions; Update tests

* refactor(settings): Update authenticated identity test

* refactor(settings): Update authenticated identity test to use OSFTestingModule

* feat(settings): Allow user to connect ORCID in profile settings page (#918)

* [ENG-10684] Update Authenticated Identity section (#924)

* feat(settings): update authenticated identity section

* style(settings): Update styles

* refactor(settings): Update Authenticated Identity section

* chore(settings): Update Authenticated identity section language (#930)

* fix(settings): Update connectOrcid to properly logging user out (#934)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants