Skip to content

Let users re-check beta access without signing out - #697

Open
kcarnold wants to merge 1 commit into
mainfrom
claude/youthful-bell-bfh41u
Open

kcarnold wants to merge 1 commit into
mainfrom
claude/youthful-bell-bfh41u

Conversation

@kcarnold

Copy link
Copy Markdown
Contributor

First of two PRs toward giving workshop participants beta access. This one is the minimal piece; the access-code flow comes next.

Why

The "not allowed" screen, which the Word task pane and the Google Docs sidebar share, had no way to see an access grant made after sign-in. The user had to sign out and back in. Its text also said access was limited to Calvin addresses only, which is no longer true.

With this change, an operator can grant access (today, alwaysAllow in the DB) while participants wait, and they click Check again instead of signing in again.

What changed

  • useDeviceAuth.refresh() / AppAuthSession.refreshUser() re-fetch the session with the current token.
    • If the session is gone, the user falls back to the login screen.
    • If the check fails in transit, the session is kept and the call rejects, so a flaky network doesn't sign anyone out.
    • fetchUserInfo now throws a typed NoSessionError so the two cases can be told apart.
  • NotAllowedScreen (moved out of pages/app/index.tsx) now:
    • shows the signed-in email, since Google's account chooser makes "wrong account" the likeliest failure;
    • adds a Check again button that reports its outcome ("still no access" vs. "couldn't check");
    • has new text.
  • The login note now says sign-in uses a Google account.

Testing

  • New unit tests cover refresh (grant picked up, session gone, transport failure) and the screen (email shown, re-check, failed check isn't reported as a denial).
  • npm test (245 passing), tsc, eslint, and prettier all pass.
  • Checked manually against a production build with a mocked get-session: not allowed → Check again → still denied → granted → the app renders.
  • Visual baselines: the login note text is inside editor-login.png and editor-login-device-code.png, so those two baselines need regenerating with the Frontend Tests workflow (update-snapshots=true).

Generated by Claude Code

The "not allowed" screen (shared by the Word task pane and the Google Docs
sidebar) had no way to pick up an access grant made after sign-in: the
user had to sign out and back in. It also said access was limited to
Calvin addresses, which is no longer the whole story.

- useDeviceAuth.refresh() / AppAuthSession.refreshUser() re-fetch the
  session with the current token. A gone session falls back to the login
  screen; a transport failure keeps the session and rejects. fetchUserInfo
  now throws a typed NoSessionError so the two can be told apart.
- NotAllowedScreen (extracted from pages/app) shows the signed-in email,
  a "Check again" button with visible outcome, and updated copy.
- Login note now says sign-in is with a Google account.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017KwGFimwoz4gnsXSUpJ1Eq
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