mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-03 16:10:31 +00:00
Handle OIDC popup flow: skip session list
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user