Skip to content

Feat/new auth workflow#248

Open
diocas wants to merge 5 commits into
cernboxfrom
feat/new_auth_workflow
Open

Feat/new auth workflow#248
diocas wants to merge 5 commits into
cernboxfrom
feat/new_auth_workflow

Conversation

@diocas
Copy link
Copy Markdown

@diocas diocas commented May 18, 2026

Attempt to change the auth workflow so that users are no longer redirected from the current page, they see a modal box saying that they are disconnected.

This is to ensure we stop losing any context due to redirections.

When disconnected, users are able to re-login via a pop-up. This should unblock all open tabs.

Its worked started on the first iteration from Rodrigo to bring pop-up auth for when web gets embedded (future implementation of the file picker).

rodcoffani and others added 4 commits May 18, 2026 11:42
Do not redirect on failure to renew session, instead show a modal.
Allow login via pop-up.
Fix flow also for embed mode.
- handleAuthError now checks userContextReady before deciding between
  the session expired modal (mid-session failure) and the access denied
  page (startup/login failure). Cleans up the anonymous-route fall-through
  that was triggering the modal during initial load or callback processing.

- accessDenied page shows "Error signing in" with an appropriate hint
  when reached via reason=loginError (startup failures); retains the
  existing "Not logged in" copy for session-expiry navigations.

- SessionExpiredModal redirects to home after a successful reconnect
  if the current route is a transient auth page (login, oidcCallback, etc.)

- Logo on accessDenied, oidcCallback and SessionExpiredModal is wrapped
  in a router-link to home.
@Gerry-Cern
Copy link
Copy Markdown

Reviewed PR 248. Popup reconnect, session-expired modal UX, and startup vs mid-session error routing look solid. Three issues should be fixed before merge:

  1. reloadUserFromStorage missing from AuthServiceInterface (useAuthService.ts, SessionExpiredModal.vue, authService.ts)

reloadUserFromStorage() is implemented on AuthService but not declared on AuthServiceInterface. SessionExpiredModal calls it via useAuthService(), which breaks vue-tsc (TS2339). login.vue is unaffected because it uses the concrete authService import.

  1. Invalid handleAuthError call in Webfinger resolve (Resolve.vue, authService.ts)

handleAuthError(route) accepts one argument. Resolve.vue calls handleAuthError(route, { forceLogout: true }). The second argument is not part of the signature and is ignored; forceLogout is not implemented. This fails TypeScript (TS2554) in the typed web-app-webfinger package build.

  1. COOP / popup Promise.race causes false "popup blocked" and lost reconnect (SessionExpiredModal.vue, login.vue)

Both use Promise.race([popupLogin, coopFallback]) with a catch that runs as soon as the popup promise rejects (blocked, dismissed, or other failure). That path closes the BroadcastChannel and sets popup-blocked UI (modal) or abandons login navigation. A COOP fallback complete message that arrives afterward has no listener, so a successful popup callback on the COOP path cannot recover the opener. Users can see a false "popup blocked" state or fail to reconnect even when auth completed in the popup window.

- Introduced `loginWithPopupCoopFallback` helper to manage popup login with a BroadcastChannel fallback for COOP scenarios.
- Updated `SessionExpiredModal` and `login` page to utilize the new helper, simplifying the handling of popup authentication.
- Removed redundant BroadcastChannel logic from both components.
- Added tests for the new helper to ensure proper functionality and error handling.
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