diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 9bec0bec..0366ab03 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -57,6 +57,7 @@ server { rewrite ^/portals /skynet/portals permanent; rewrite ^/stats /skynet/stats permanent; rewrite ^/skynet/blacklist /skynet/blocklist permanent; + rewrite ^/secure/(.*) https://secure.$domain.$tld/$1; location / { # This is only safe workaround to reroute based on some conditions @@ -347,12 +348,6 @@ server { proxy_pass http://127.0.0.1/$uri?attachment=true&$args; } - location /secure { - rewrite /secure/(.*) /$1 break; - proxy_redirect http://127.0.0.1/ https://$host/; - proxy_pass http://oathkeeper:4455; - } - # include custom locations, specific to the server include /etc/nginx/conf.d/server-override/*; } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index cc07b31d..624c28c5 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -20,6 +20,7 @@ "gatsby-source-filesystem": "2.4.0", "gatsby-transformer-sharp": "2.5.21", "http-status-codes": "2.1.4", + "js-cookie": "^2.2.1", "jsonp": "0.2.1", "node-sass": "4.14.1", "path-browserify": "1.0.1", diff --git a/packages/webapp/src/components/HomeTop/HomeTop.js b/packages/webapp/src/components/HomeTop/HomeTop.js index adf0951c..e3afcef5 100644 --- a/packages/webapp/src/components/HomeTop/HomeTop.js +++ b/packages/webapp/src/components/HomeTop/HomeTop.js @@ -1,9 +1,12 @@ 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 (
- - Sign up now! - {" "} - Already have an account?{" "} - - Log in! - + {authenticated ? ( + <> + Welcome back! Go to your{" "} + + dashboard + + > + ) : ( + <> + + Sign up now! + {" "} + Already have an account?{" "} + + Log in! + + > + )}