Skip to content

Commit

Permalink
🐛 Fix linking page
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachwahl committed Sep 22, 2024
1 parent d5a6a8f commit 6b85c7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/pages/Link.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Link.jsx +
+ +
+ Copyright (c) 2022 Robin Ferch +
+ Copyright (c) 2022-2024 Robin Ferch +
+ https://robinferch.me +
+ This project is released under the MIT license. +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

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 <Navigate to={"/"}/>

const [active, setActive] = useState(0);
Expand All @@ -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
}
});

Expand Down

0 comments on commit 6b85c7c

Please sign in to comment.