aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/app/main.go1
-rw-r--r--cmd/web/js/app.js4
-rw-r--r--cmd/web/js/main.jsx12
-rw-r--r--cmd/web/js/poloniex.jsx6
4 files changed, 22 insertions, 1 deletions
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() {
145 "/me", 145 "/me",
146 "/otp/enroll", 146 "/otp/enroll",
147 "/otp/validate", 147 "/otp/validate",
148 "/not_confirmed",
148 } 149 }
149 150
150 for _, route := range availableRoutes { 151 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) {
62 } 62 }
63 63
64 cookies.setItem('jwt', token, cookieExpire); 64 cookies.setItem('jwt', token, cookieExpire);
65 page('/not_confirmed');
65}; 66};
66 67
67App.getUserJWT = function() { 68App.getUserJWT = function() {
@@ -104,6 +105,9 @@ App.onUserNotAuthorized = function(httpCode, apiCode) {
104 case 'need_otp_validation': 105 case 'need_otp_validation':
105 page('/otp/validate'); 106 page('/otp/validate');
106 return false; 107 return false;
108 case 'user_not_confirmed':
109 page('/not_confirmed');
110 return false;
107 default: 111 default:
108 return true; 112 return true;
109 } 113 }
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) {
54 </div>); 54 </div>);
55}); 55});
56 56
57App.page('/not_confirmed', true, function(context) {
58 App.mount(<div>
59 <Logo />
60 <div className="row">
61 <div className="box offset-3 col-6 text-center">
62 <p>Please be patient, you account is being confirmed...</p>
63 <p><a href="/me"><u>Refresh</u></a></p>
64 </div>
65 </div>
66 </div>);
67});
68
57App.page('/otp/setup', true, function(context) { 69App.page('/otp/setup', true, function(context) {
58 Api.Call('OTP_ENROLL', {}, function(err, status, data) { 70 Api.Call('OTP_ENROLL', {}, function(err, status, data) {
59 if (err) { 71 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';
5class PoloniexController extends React.Component { 5class PoloniexController extends React.Component {
6 constructor(props) { 6 constructor(props) {
7 super(props); 7 super(props);
8 this.state = {'apiKey': '', 'apiSecret': '', 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; 8 this.state = {'apiKey': '', 'apiSecret': '', 'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
9 } 9 }
10 10
11 handleCredentialsChange = (key, secret) => { 11 handleCredentialsChange = (key, secret) => {
@@ -43,6 +43,7 @@ class PoloniexController extends React.Component {
43 43
44 componentDidMount = () => { 44 componentDidMount = () => {
45 Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) { 45 Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) {
46 this.setState({'apiRequested': true});
46 if (err) { 47 if (err) {
47 console.error(err, data); 48 console.error(err, data);
48 return; 49 return;
@@ -74,6 +75,9 @@ class PoloniexController extends React.Component {
74 default: 75 default:
75 displayText = null; 76 displayText = null;
76 } 77 }
78 if (this.state.apiRequested === false) {
79 return <div></div>;
80 }
77 return ( 81 return (
78 <div> 82 <div>
79 <PoloniexBalance balanceCurrency={this.state.valueCurrency} 83 <PoloniexBalance balanceCurrency={this.state.valueCurrency}