Can sign out

This commit is contained in:
2023-06-09 18:27:03 +02:00
parent 3ca941bd57
commit fea2059433
3 changed files with 37 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { Button, CircularProgress } from "@mui/material";
import { useEffect, useRef, useState } from "react";
import { Link, useSearchParams } from "react-router-dom";
import { Link, useNavigate, useSearchParams } from "react-router-dom";
import { AuthApi } from "../../api/AuthApi";
import { useSetAtom } from "jotai";
@ -9,6 +9,7 @@ import { useSetAtom } from "jotai";
*/
export function OIDCCbRoute(): React.ReactElement {
const setAuth = useSetAtom(AuthApi.authStatus);
const navigate = useNavigate();
const [error, setError] = useState(false);
@ -27,6 +28,7 @@ export function OIDCCbRoute(): React.ReactElement {
count.current = code!;
await AuthApi.FinishOpenIDLogin(code!, state!);
navigate("/");
setAuth(true);
} catch (e) {
console.error(e);