feat(tenant_context): enhance effective_club_id resolution for platform admins without header
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Successful in 31s
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Successful in 31s
- Updated resolve_tenant_context to use stored active_club_id if the club exists when no header is provided. - Adjusted comments for clarity regarding platform admin behavior. - Added unit tests to verify new behavior for platform admins in test_access_layer.py. version bump to 1.0.5 for tenant_context module.
This commit is contained in:
1 parent
d3055f6f2f
commit
3ff47779e0
7 files changed
+121
-14
No files matched your search
@@ -64,11 +64,25 @@ export function AuthProvider({ children }) {
|
||||
const uid = userRef.current?.id
|
||||
if (!Number.isFinite(cid) || cid < 1 || !uid) return
|
||||
localStorage.setItem(ACTIVE_CLUB_STORAGE_KEY, String(cid))
|
||||
setUser((prev) => (prev?.id ? { ...prev, active_club_id: cid } : prev))
|
||||
setUser((prev) =>
|
||||
prev?.id
|
||||
? { ...prev, active_club_id: cid, effective_club_id: cid }
|
||||
: prev
|
||||
)
|
||||
try {
|
||||
await api.updateProfile(uid, { active_club_id: cid })
|
||||
const profile = await api.getCurrentProfile()
|
||||
syncStoredActiveClub(profile)
|
||||
setUser(profile)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
try {
|
||||
const profile = await api.getCurrentProfile()
|
||||
syncStoredActiveClub(profile)
|
||||
setUser(profile)
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in new issue
Block a user