1 import SignupForm from './signup.js';
2 import SigninForm from './signin.js';
3 import PasswordResetForm from './password_reset.js';
4 import ChangePasswordForm from './change_password.js';
5 import OtpEnrollForm from './otp.js';
6 import PoloniexController from './poloniex.js';
7 import UserAccount from './account.js';
8 import App from './app.js';
9 import Api from './api.js';
10 import cookies from './cookies.js';
11 import React from 'react';
14 App.page('/signup', false, function(context) {
15 if (App.isUserSignedIn()) {
21 <SignupForm onSuccess={App.onUserSignUp}/>
25 App.page('/signin', false, function(context) {
26 if (App.isUserSignedIn()) {
32 <SigninForm onSuccess={App.onUserSignIn}/>
36 App.page('/reset-password', false, function(context) {
37 if (App.isUserSignedIn()) {
47 App.page('/change-password', false, function(context) {
48 if (App.isUserSignedIn()) {
53 var token = qs.parse(context.querystring).token;
55 if (token === undefined) {
61 <ChangePasswordForm token={token} onSuccess={App.go.bind(App, '/signin')}/>
65 App.page('/confirm', false, function(context) {
66 var token = qs.parse(context.querystring).token;
68 if (token === undefined) {
76 function(err, status, data) {
78 console.error(err, data);
86 App.page('/signout', true, function(context) {
87 cookies.removeItem('jwt');
92 App.page('/me', true, function(context) {
98 App.page('/account', true, function(context) {
104 App.page('/not_confirmed', true, function(context) {
106 <div className="row">
107 <div className="box offset-3 col-6 text-center">
108 <p>An email has now been sent to your email address.</p>
109 <p>{'Please click the \'Confirm your account\' button to validate your email.'}</p>
115 App.page('/otp/setup', true, function(context) {
116 Api.Call('OTP_ENROLL', {}, function(err, status, data) {
118 console.error(err, data);
123 <OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/>
129 App.page('/otp/validate', true, function(context) {
131 <OtpEnrollForm onSuccess={App.onUserValidateOtp} />
135 App.page('/', false, function(context) {
139 $(document).ready(function() {