From 6b85c7cd65353a65deab144cabf2281a61710a32 Mon Sep 17 00:00:00 2001 From: Robin Ferch Date: Sun, 22 Sep 2024 20:42:18 +0200 Subject: [PATCH] :bug: Fix linking page --- frontend/src/pages/Link.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Link.jsx b/frontend/src/pages/Link.jsx index 83b3d0e..ffd94eb 100644 --- a/frontend/src/pages/Link.jsx +++ b/frontend/src/pages/Link.jsx @@ -1,7 +1,7 @@ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Link.jsx + + + - + Copyright (c) 2022 Robin Ferch + + + Copyright (c) 2022-2024 Robin Ferch + + https://robinferch.me + + This project is released under the MIT license. + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -9,16 +9,16 @@ import React, {useState} from 'react'; import {Box, Button, Code, Container, Group, Kbd, Stepper, TextInput, Title} from "@mantine/core"; import {useForm} from "@mantine/form"; -import {useKeycloak} from "@react-keycloak-fork/web"; import {Navigate, useNavigate} from "react-router-dom"; import NavHeader from "../components/NavHeader"; import {showNotification} from "@mantine/notifications"; import axios from "axios"; +import {useOidc} from "../oidc"; const Link = props => { - const {keycloak} = useKeycloak() + const { isUserLoggedIn, login, logout, oidcTokens } = useOidc(); - if (!keycloak?.authenticated) + if (!isUserLoggedIn) return const [active, setActive] = useState(0); @@ -37,7 +37,7 @@ const Link = props => { status } = await axios.post(`/api/v1/user/link`, {code}, { headers: { - authorization: "Bearer " + keycloak.token + authorization: "Bearer " + oidcTokens.accessToken } });