dont rely on cookie
This commit is contained in:
parent
c806129ba7
commit
50975b0c5e
|
@ -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?{" "}
|
||||
<a href="/secure/auth/login" className="link">
|
||||
Log in!
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
<a href="/secure/auth/registration" className="link">
|
||||
Sign up now!
|
||||
</a>{" "}
|
||||
| Already have an account? Go to your{" "}
|
||||
<a href="/secure/auth/login" className="link">
|
||||
dashboard
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<Deco1 className="deco-1" />
|
||||
|
|
Reference in New Issue