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 (
Skynet logo @@ -16,13 +19,24 @@ export default function HomeTop() {

- - 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! + + + )}

diff --git a/yarn.lock b/yarn.lock index 460bd1c2..1237c922 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8647,6 +8647,11 @@ js-base64@^2.1.8: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4" integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ== +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8795,6 +8800,11 @@ junk@^3.1.0: resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1" integrity sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ== +jwt-decode@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59" + integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A== + keyv@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373"