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