Handle OIDC popup flow: skip session list

This commit is contained in:
jelveh
2026-05-01 23:49:35 -07:00
parent 5b35a5db69
commit 4395c8bea5
2 changed files with 19 additions and 8 deletions
@@ -567,6 +567,10 @@ if (window.opener) {
target = origin || '/';
}
if (stateDecoded.embedded_in_popup) {
target = appendQueryParam(target, 'oidc_login', 'true');
}
if (extraQueryParams) {
for (const [k, v] of Object.entries(extraQueryParams)) {
if (v != null) target = appendQueryParam(target, k, v);
+15 -8
View File
@@ -476,16 +476,23 @@ window.initgui = async function (options) {
// let's log the error for now in case a change in state occurred.
console.error('error in \'sign-in\' flow', e);
}
// Always show session list so user sees their account(s); after OIDC they will see the one they signed into
picked_a_user_for_sdk_login = await UIWindowSessionList({
reload_on_success: false,
draggable_body: false,
has_head: false,
cover_page: true,
});
if ( picked_a_user_for_sdk_login ) {
if ( window.url_query_params.get('oidc_login') === 'true' ) {
// OIDC login just completed in popup — skip session list and finish the flow
picked_a_user_for_sdk_login = true;
await window.getUserAppToken(window.openerOrigin);
} else {
// Show session list so user can pick which account to use
picked_a_user_for_sdk_login = await UIWindowSessionList({
reload_on_success: false,
draggable_body: false,
has_head: false,
cover_page: true,
});
if ( picked_a_user_for_sdk_login ) {
await window.getUserAppToken(window.openerOrigin);
}
}
}
}