Skip to content

fix: refactor institution handling in user authorization and mutation#1289

Open
jekabs-karklins wants to merge 16 commits intodevelopfrom
SWAP-5157-update-upsertuserbyoidcsub
Open

fix: refactor institution handling in user authorization and mutation#1289
jekabs-karklins wants to merge 16 commits intodevelopfrom
SWAP-5157-update-upsertuserbyoidcsub

Conversation

@jekabs-karklins
Copy link
Contributor

@jekabs-karklins jekabs-karklins commented Dec 10, 2025

Description

This PR refactors the way institution is defined when calling upserUserByOidc

Motivation and Context

This change allows to call upserUserByOidc and specify institution in two ways
Either specifying

RorId
or
{institutionName: string, institutionCountry: string}

Changes

  1. Refactored getOrCreateUserInstitution method in OAuthAuthorization to accept different types of input (ROR ID, manual input, institution ID), and split into smaller, more specific methods.
  2. Updated getOrCreateUserInstitution method in StfcUserAuthorization to match the new input type.
  3. Updated getOrCreateUserInstitution method in UserAuthorization to match the new input type.

How Has This Been Tested

Unit tests have been added and updated and run to ensure the changes work as expected. Additionally, manual testing has been performed to verify correct functionality in a live environment.

Fixes Jira Issue

https://jira.esss.lu.se/browse/SWAP-5157

@jekabs-karklins jekabs-karklins requested a review from a team as a code owner December 10, 2025 10:46
@jekabs-karklins jekabs-karklins requested review from Scott-James-Hurley and removed request for a team December 10, 2025 10:46
@jekabs-karklins jekabs-karklins marked this pull request as draft December 10, 2025 12:24
@jekabs-karklins jekabs-karklins changed the title feat: refactor institution handling in user authorization and mutations [WIP] feat: refactor institution handling in user authorization and mutations Dec 10, 2025
@jekabs-karklins jekabs-karklins changed the title [WIP] feat: refactor institution handling in user authorization and mutations fix: refactor institution handling in user authorization and mutations [WIP] Dec 17, 2025
@jekabs-karklins jekabs-karklins changed the title fix: refactor institution handling in user authorization and mutations [WIP] fix: refactor institution handling in user authorization and mutation Feb 24, 2026
Comment on lines +44 to +46
rorId?: string | null;
name?: string | null;
country?: string | null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

comment: Setting null will set the value to null, leaving undefined will take the defautl value

@jekabs-karklins jekabs-karklins marked this pull request as ready for review February 24, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant