feat: improve OIDC login flow and stores handling
Some checks failed
TrafficCue CI / check (push) Failing after 1m58s
TrafficCue CI / build-android (push) Has been cancelled
TrafficCue CI / build (push) Has started running

This commit is contained in:
2025-09-29 18:54:12 +02:00
parent 004ba9047f
commit f5e1e23cdd
6 changed files with 89 additions and 39 deletions

View File

@ -33,9 +33,9 @@
<Button
onclick={async () => {
const auth = await getAuthURL();
// localStorage.setItem("lnv-codeVerifier", auth.codeVerifier);
// localStorage.setItem("lnv-oidcstate", auth.state);
const popup = window.open(auth.url, "Login", "width=500,height=600");
localStorage.setItem("lnv-codeVerifier", auth.codeVerifier);
localStorage.setItem("lnv-oidcstate", auth.state);
location.href = auth.url;
window.addEventListener("message", async (e) => {
if (e.origin !== window.location.origin) return;
@ -45,7 +45,6 @@
console.error("Invalid response from popup");
return;
}
popup?.close();
if (state !== auth.state) {
alert("State mismatch. Please try again.");
return;