mirror of
https://github.com/elder-plinius/G0DM0D3.git
synced 2026-11-16 07:02:25 +00:00
fix: block stale OAuth exchange in local-only mode
This commit is contained in:
@@ -4718,6 +4718,14 @@ RESPOND WITH EXACTLY ONE LINE. No explanation, no preamble.`;
|
||||
const cleanUrl = window.location.origin + window.location.pathname;
|
||||
window.history.replaceState({}, '', cleanUrl);
|
||||
|
||||
// A stale OAuth callback must never re-enable a cloud request while
|
||||
// strict local-only mode is active.
|
||||
if (state.localOnly) {
|
||||
sessionStorage.removeItem('or_code_verifier');
|
||||
sessionStorage.removeItem('or_callback_url');
|
||||
return false;
|
||||
}
|
||||
|
||||
const codeVerifier = sessionStorage.getItem('or_code_verifier');
|
||||
if (!codeVerifier) {
|
||||
console.warn('[OAuth] Got code but no verifier in session — stale callback?');
|
||||
|
||||
Reference in New Issue
Block a user