Files
tmail-flutter/web/js/logout-callback.js
Dat VuandDat H. Pham d043c98431 Move inline web scripts to files and enforce the nginx page policy (#5115)
* Move inline web scripts to files and enforce the nginx page policy

* Render CSP_* through the nginx image entrypoint and allow blob: in connect-src

* Allow CSP_IMG_SRC and document nginx add_header inheritance and connect-src ports

* Keep a read-only logo mount from stopping nginx and add optional CSP_REPORT_URI

* fix: start nginx when the root or a logo mount is read-only

* docs: document the web CSP variables and upgrade steps

---------

Co-authored-by: Dat H. Pham <dphamhoang@linagora.com>
2026-11-08 10:54:57 +07:00

16 lines
700 B
JavaScript

const AUTH_RESPONSE_KEY = "auth_info";
const CODE_VERIFIER_KEY = "auth_code_verifier";
window.onload = function () {
try {
sessionStorage.removeItem(AUTH_RESPONSE_KEY);
sessionStorage.removeItem(CODE_VERIFIER_KEY);
localStorage.removeItem(AUTH_RESPONSE_KEY);
localStorage.removeItem(CODE_VERIFIER_KEY);
// A caller-supplied redirect target is never followed; "./" keeps subpath (--base-href) deploys inside the app.
window.location.replace("./");
} catch (error) {
console.error("[Logout Auth Redirect] Redirection failed:", error);
window.location.replace("./");
}
}