From adf936f66a5c59e6cc2e7a1c644148e0f119e5c8 Mon Sep 17 00:00:00 2001 From: jloup Date: Sun, 25 Feb 2018 18:43:48 +0100 Subject: /not_confirmed page. --- cmd/app/main.go | 1 + cmd/web/js/app.js | 4 ++++ cmd/web/js/main.jsx | 12 ++++++++++++ cmd/web/js/poloniex.jsx | 6 +++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cmd/app/main.go b/cmd/app/main.go index e769401..4bd77bd 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -145,6 +145,7 @@ func main() { "/me", "/otp/enroll", "/otp/validate", + "/not_confirmed", } for _, route := range availableRoutes { diff --git a/cmd/web/js/app.js b/cmd/web/js/app.js index 8573b6e..d8189e0 100644 --- a/cmd/web/js/app.js +++ b/cmd/web/js/app.js @@ -62,6 +62,7 @@ App.onUserSignUp = function(token) { } cookies.setItem('jwt', token, cookieExpire); + page('/not_confirmed'); }; App.getUserJWT = function() { @@ -104,6 +105,9 @@ App.onUserNotAuthorized = function(httpCode, apiCode) { case 'need_otp_validation': page('/otp/validate'); return false; + case 'user_not_confirmed': + page('/not_confirmed'); + return false; default: return true; } diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index 827b83d..79bf976 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -54,6 +54,18 @@ App.page('/me', true, function(context) { ); }); +App.page('/not_confirmed', true, function(context) { + App.mount(
+ +
+
+

Please be patient, you account is being confirmed...

+

Refresh

+
+
+
); +}); + App.page('/otp/setup', true, function(context) { Api.Call('OTP_ENROLL', {}, function(err, status, data) { if (err) { diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 96384fd..a5fb9a7 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -5,7 +5,7 @@ import React from 'react'; class PoloniexController extends React.Component { constructor(props) { super(props); - this.state = {'apiKey': '', 'apiSecret': '', 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; + this.state = {'apiKey': '', 'apiSecret': '', 'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; } handleCredentialsChange = (key, secret) => { @@ -43,6 +43,7 @@ class PoloniexController extends React.Component { componentDidMount = () => { Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) { + this.setState({'apiRequested': true}); if (err) { console.error(err, data); return; @@ -74,6 +75,9 @@ class PoloniexController extends React.Component { default: displayText = null; } + if (this.state.apiRequested === false) { + return
; + } return (