Skip to content

Fix OAuth device verification JavaScript to use correct service endpoints#583

Merged
nycomp merged 1 commit intoweeklyfrom
bugfix/oauth-redirect-scheme-fix
May 6, 2026
Merged

Fix OAuth device verification JavaScript to use correct service endpoints#583
nycomp merged 1 commit intoweeklyfrom
bugfix/oauth-redirect-scheme-fix

Conversation

@nycomp
Copy link
Copy Markdown
Contributor

@nycomp nycomp commented May 6, 2026

Summary

The device verification page (served by campus.auth) was making JavaScript fetch requests to /api/v1/users/me and /api/v1/oauth/device/authorize. These paths route to campus.api service (different domain), so the Flask session cookie from campus.auth wasn't being sent, causing authentication checks to fail after Google OAuth login.

Changes

  • Add /oauth/users/me endpoint in campus.auth that returns current user from Flask session (no bearer token required)
  • Change JavaScript fetch URLs to use relative paths (./users/me and ./authorize) to keep requests within campus.auth service
  • Add test for the new /oauth/users/me endpoint

Fixes

Fixes issue where device authorization showed "You must be logged in to authorize a device" error immediately after successful Google authentication when using campus auth login CLI command.

Test Plan

  • All 11 OAuth integration tests pass
  • New test for /oauth/users/me endpoint passes
  • Manual testing of OAuth device flow end-to-end

🤖 Generated with Claude Code

…ints

The device verification page (served by campus.auth) was making JavaScript
fetch requests to /api/v1/users/me and /api/v1/oauth/device/authorize.
These paths route to campus.api service (different domain), so the Flask
session cookie from campus.auth wasn't being sent, causing authentication
checks to fail after Google OAuth login.

Changes:
- Add /oauth/users/me endpoint in campus.auth that returns current user
  from Flask session (no bearer token required)
- Change JavaScript fetch URLs to use relative paths (./users/me and
  ./authorize) to keep requests within campus.auth service
- Add test for the new /oauth/users/me endpoint

Fixes issue where device authorization showed "You must be logged in to
authorize a device" error immediately after successful Google authentication.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@nycomp nycomp merged commit 4634b54 into weekly May 6, 2026
8 checks passed
@nycomp nycomp deleted the bugfix/oauth-redirect-scheme-fix branch May 6, 2026 23:53
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.

2 participants