feat(oidc): kick off code+PKCE flow on /login instead of HubRedirect #50

Merged
YousifShkara merged 1 commit from feat/start-authorize-on-sign-in into main 2026-06-03 03:14:42 +02:00
Owner

The /login route's Login component was still a pre-OIDC dev shortcut: it
HubRedirect'd straight to bunyip's /login, which is why "Sign in" on
msp.a8n.systems just looped back to bunyip's dashboard. Every other piece
of the cutover assumed the SPA would actually start a PKCE handshake here.

Replace HubRedirect with the same start_login(cfg, "/dashboard") call
AuthGuard already runs for protected routes. The browser navigates to
{issuer}/oauth2/authorize?response_type=code&client_id=...&code_challenge=...&...
and the round-trip completes via the existing /auth/callback handler
(src/pages/auth_callback.rs), which exchanges the code at the token
endpoint, parses claims, and lands the user on /dashboard.

Update the AuthGuard comment block while we're here: it called /login a
"legacy redirect stub". It's an active OIDC kickoff now.

The /login route's Login component was still a pre-OIDC dev shortcut: it HubRedirect'd straight to bunyip's /login, which is why "Sign in" on msp.a8n.systems just looped back to bunyip's dashboard. Every other piece of the cutover assumed the SPA would actually start a PKCE handshake here. Replace HubRedirect with the same start_login(cfg, "/dashboard") call AuthGuard already runs for protected routes. The browser navigates to {issuer}/oauth2/authorize?response_type=code&client_id=...&code_challenge=...&... and the round-trip completes via the existing /auth/callback handler (src/pages/auth_callback.rs), which exchanges the code at the token endpoint, parses claims, and lands the user on /dashboard. Update the AuthGuard comment block while we're here: it called /login a "legacy redirect stub". It's an active OIDC kickoff now.
feat(oidc): kick off code+PKCE flow on /login instead of HubRedirect
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 28s
a6959f8de7
The /login route's Login component was still a pre-OIDC dev shortcut: it
HubRedirect'd straight to bunyip's /login, which is why "Sign in" on
msp.a8n.systems just looped back to bunyip's dashboard. Every other piece
of the cutover assumed the SPA would actually start a PKCE handshake here.

Replace HubRedirect with the same start_login(cfg, "/dashboard") call
AuthGuard already runs for protected routes. The browser navigates to
{issuer}/oauth2/authorize?response_type=code&client_id=...&code_challenge=...&...
and the round-trip completes via the existing /auth/callback handler
(src/pages/auth_callback.rs), which exchanges the code at the token
endpoint, parses claims, and lands the user on /dashboard.

Update the AuthGuard comment block while we're here: it called /login a
"legacy redirect stub". It's an active OIDC kickoff now.
YousifShkara deleted branch feat/start-authorize-on-sign-in 2026-06-03 03:14:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!50
No description provided.