202 feature sync user role - #203
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces role synchronization on view appearance in both AdminMainViewController and MainViewController by reissuing tokens, checking the user's profile role, and switching view controllers if the role has changed. It also updates GOMSRefreshToken to parse the role from the JWT payload and update the authority keychain. The review feedback highlights critical improvements: handling Base64URL encoding during JWT payload decoding to prevent decoding failures, removing redundant network calls in MainViewController, and adding a visibility guard check in AdminMainViewController before executing asynchronous UI and navigation updates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR addresses stale in-app permission state after Discord role sync by forcing a token reissue on app entry/foreground and ensuring the app immediately reflects updated user roles (student vs. student council) by switching between Main and Admin main screens.
Changes:
- Add role-sync flow on
viewWillAppearfor both user/admin main screens (syncRoleAndFetch()), including automatic screen switching when role changes. - Update refresh-token reissue handling to decode the new access token’s JWT payload and immediately persist the latest role to the
authoritykeychain entry. - Replace direct
fetchData()calls on entry with the new role-sync + fetch flow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| Projects/Feature/Sources/Scene/Main/User/View/MainViewController.swift | Replaces entry-time data fetch with a token reissue + role check that can redirect to admin main. |
| Projects/Feature/Sources/Scene/Main/Admin/View/AdminMainViewController.swift | Adds token reissue + role check on entry that can redirect back to user main. |
| Projects/Feature/Sources/Extension/GOMSRefreshToken.swift | Parses role from newly issued access token and writes it into keychain immediately. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
23fbc9d to
8cb98f5
Compare
🍎 개요
📦 작업 내용
🔀 :: #202