refactor(auth): migrate session storage to JWT with persistent secret (#508)
- Replace in-memory session Map with stateless JWT tokens - Add jose library for JWT signing and verification - Implement persistent JWT secret storage in ~/.config/openchamber - Support OPENCODE_JWT_SECRET environment variable override - Update SessionAuthGate and useServerSessionStatus hooks - Remove session cleanup timer (JWTs are stateless) Co-authored-by: Jovines <jovines@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jovines
parent
5473381720
commit
7a151290be
@@ -78,6 +78,10 @@ export function useServerSessionStatus() {
|
||||
headers: { Accept: 'application/json' },
|
||||
}).then(async (r) => {
|
||||
if (!r.ok) {
|
||||
console.warn('[useServerSessionStatus] API returned', r.status);
|
||||
if (r.status === 401) {
|
||||
console.warn('[useServerSessionStatus] Authentication required - session may have expired');
|
||||
}
|
||||
throw new Error(String(r.status));
|
||||
}
|
||||
return (await r.json()) as ServerSnapshotResponse;
|
||||
|
||||
Reference in New Issue
Block a user