dont rely on cookie

This commit is contained in:
Karol Wypchlo 2020-12-16 18:25:34 +01:00
parent c806129ba7
commit 50975b0c5e
1 changed files with 7 additions and 21 deletions

View File

@ -1,12 +1,9 @@
import React from "react";
import Cookies from "js-cookie";
import logo from "../../images/logo.svg";
import "./HomeTop.scss";
import { Skynet, Deco1, Deco2 } from "../../svg";
export default function HomeTop() {
const authenticated = Boolean(Cookies.get("skynet-jwt"));
return (
<div className="home-top">
<img src={logo} alt="Skynet logo" className="logo" />
@ -19,24 +16,13 @@ export default function HomeTop() {
</p>
<p className="auth-links">
{authenticated ? (
<>
Welcome back! Go to your{" "}
<a href="/secure/" className="link">
dashboard
</a>
</>
) : (
<>
<a href="/secure/auth/registration" className="link">
Sign up now!
</a>{" "}
Already have an account?{" "}
| Already have an account? Go to your{" "}
<a href="/secure/auth/login" className="link">
Log in!
dashboard
</a>
</>
)}
</p>
<Deco1 className="deco-1" />