Skip to content

Commit fc9a083

Browse files
committed
bug: fix mapping of multiple globus accounts.
1 parent b1ff077 commit fc9a083

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

web/datafed-ws.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,19 @@ the registration page.
592592

593593
a_resp.redirect("/ui/register");
594594
} else {
595+
if ( reply.user.length > 1 ) {
596+
logger.warn("ui/authn", getCurrentLineNumber(), "More than one user was returned from DataFed, this can happen if a user has registered two or more separate accounts with DataFed and has since linked their identities from a third party identity manager. DataFed will select the first identity when logging in.");
597+
598+
}
599+
let username = reply.user[0]?.uid?.replace(/^u\//, '');
595600
logger.info(
596601
"/ui/authn",
597602
getCurrentLineNumber(),
598603
"User: " +
599604
uid +
600-
" verified, acc:" +
605+
" verified, mapped to: " +
606+
username +
607+
" acc:" +
601608
xfr_token.access_token +
602609
", ref: " +
603610
xfr_token.refresh_token +
@@ -606,7 +613,7 @@ the registration page.
606613
);
607614

608615
// Store only data needed for active session
609-
a_req.session.uid = uid;
616+
a_req.session.uid = username;
610617
a_req.session.reg = true;
611618

612619
let redirect_path = "/ui/main";

0 commit comments

Comments
 (0)