fix: prevent silent reauth in non-teacher/devlogin mode and use lightweight refresh#487
Merged
Conversation
…weight refresh Three fixes: 1. Skip attemptSilentReauth when mode is not 'teacher' or devlogin is used — prevents Google One Tap from appearing in student mode or when using dev bypass token 2. Auto-refresh (30s) now uses refreshMembersOnly instead of full loadClassroomDetail — only updates the members list without touching selectedClassroom, preserving: - Assignment name input field - Member detail pane (screenshot carousel index, comment input) - Any other UI state in the detail view 3. refreshMembersOnly uses JSON comparison to skip state updates when data hasn't changed, preventing unnecessary re-renders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🚀 Preview deployed: https://smalruby.jp/smalruby3-editor/fix/devlogin-relogin/ |
When silent reauth fails, the expired idToken remained set, so the 30-second auto-refresh timer kept firing, causing repeated 401 → attemptSilentReauth → One Tap display → cancel cycles. Fix: set idToken to null when reauth fails. This stops the auto-refresh useEffect (condition requires idToken to be truthy) and prevents the One Tap loop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove console.log debug statements from handleTeacher401 and refreshMembersOnly - Add ID_TOKEN_MAX_AGE_SECONDS support to Lambda: custom iat-based token age check for shorter session testing - Pass ID_TOKEN_MAX_AGE_SECONDS env var through CDK stack conditionally Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 11, 2026
…relogin fix: prevent silent reauth in non-teacher/devlogin mode and use lightweight refresh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
3つの問題を修正:
1. devlogin / 生徒モードで Google One Tap が表示される
attemptSilentReauthに mode ガードを追加mode !== 'teacher'または?devloginパラメータがある場合はスキップ2. 30秒リフレッシュで入力内容がクリアされる
loadClassroomDetail(全データ更新)からrefreshMembersOnly(メンバー一覧のみ更新)に変更selectedClassroomに触れないため、課題名入力フォームが保持される3. 不要な再レンダリング防止
refreshMembersOnlyで JSON 比較により、データが変わっていない場合は state 更新をスキップTest plan
?devlogin=xxxで先生ログイン → Google One Tap が出ない🤖 Generated with Claude Code