step 1 ? nn en vrai j'y crois pas

This commit is contained in:
Guillem George 2026-05-15 18:31:16 +02:00
parent 168a35f9de
commit 414aec97e5
3 changed files with 175 additions and 124 deletions

View file

@ -1,20 +1,20 @@
import * as auth from "../../../utils/auth"
import * as auth from "../../../utils/auth";
let code;
try {
const params = new URLSearchParams(window.location.search)
code = params.get("code")
}
catch {
console.error("Unable to retrieve code")
alert("Unable to retrieve code")
const params = new URLSearchParams(window.location.search);
code = params.get("code");
} catch {
console.error("Unable to retrieve code");
alert("Unable to retrieve code");
}
if (! await auth.getToken(code)) {
console.error("Unable to retrieve token")
alert("Unable to retrieve token")
if (!(await auth.getToken(code))) {
console.error("Unable to retrieve token");
alert("Unable to retrieve token");
}
console.debug("Redirecting...")
window.location = import.meta.env.VITE_URL
console.debug("Redirecting...");
window.location = import.meta.env.VITE_URL;