feat: improve OIDC login flow and stores handling
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user