step 1 ? nn en vrai j'y crois pas
This commit is contained in:
parent
168a35f9de
commit
414aec97e5
3 changed files with 175 additions and 124 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue