X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fmain.jsx;h=8a4fce81e35dba21ff6096b629e47f36c2454fb4;hb=87b6d05e5b289f3e9d1554fe455296ba09655c3a;hp=e64adc777c06dda795c5296d813be74b0e81bcb5;hpb=a2ab2260d38391006651f5f5cb1627bce836d1fa;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index e64adc7..8a4fce8 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,40 +1,14 @@ 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'; - -class Header extends React.Component { - render = () => { - if (this.props.displayLogout === true) { - return ; - } - return ; - - } -} - -class Logo extends React.Component { - render() { - return ; - } -} +import qs from 'qs'; App.page('/signup', false, function(context) { if (App.isUserSignedIn()) { @@ -43,7 +17,6 @@ App.page('/signup', false, function(context) { } App.mount(
-
); }); @@ -55,11 +28,39 @@ 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'); @@ -68,14 +69,12 @@ 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...

@@ -93,7 +92,6 @@ App.page('/otp/setup', true, function(context) { } App.mount(
-
); @@ -102,7 +100,6 @@ App.page('/otp/setup', true, function(context) { App.page('/otp/validate', true, function(context) { App.mount(
-
); });