X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fmain.jsx;h=909f1bd9a26f5b8037069b2d96a91dd98d900e29;hb=85545aba62546f219a9c9730945511412a3174ef;hp=79bf97674493ea9cf392e3f8762e8d330346d533;hpb=adf936f66a5c59e6cc2e7a1c644148e0f119e5c8;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index 79bf976..909f1bd 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,19 +1,41 @@ import SignupForm from './signup.js'; import SigninForm from './signin.js'; +import PasswordResetForm from './password_reset.js'; +import ChangePasswordForm from './change_password.js'; import OtpEnrollForm from './otp.js'; import PoloniexController from './poloniex.js'; import App from './app.js'; import Api from './api.js'; import cookies from './cookies.js'; import React from 'react'; +import qs from 'qs'; + +class Header extends React.Component { + render = () => { + if (this.props.displayLogout === true) { + return ; + } + return ; + + } +} class Logo extends React.Component { render() { - return
- -
; + return ; } } @@ -24,7 +46,7 @@ App.page('/signup', false, function(context) { } App.mount(
- +
); }); @@ -36,11 +58,42 @@ App.page('/signin', false, function(context) { } App.mount(
- +
); }); +App.page('/reset-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + App.mount(
+
+ +
); +}); + +App.page('/change-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + var token = qs.parse(context.querystring).token; + + if (token === undefined) { + App.go('/'); + return; + } + + App.mount(
+
+ +
); +}); + App.page('/signout', true, function(context) { cookies.removeItem('jwt'); @@ -49,14 +102,14 @@ App.page('/signout', true, function(context) { App.page('/me', true, function(context) { App.mount(
- +
); }); App.page('/not_confirmed', true, function(context) { App.mount(
- +

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

@@ -74,7 +127,7 @@ App.page('/otp/setup', true, function(context) { } App.mount(
- +
); @@ -83,7 +136,7 @@ App.page('/otp/setup', true, function(context) { App.page('/otp/validate', true, function(context) { App.mount(
- +
); });