aboutsummaryrefslogtreecommitdiff
path: root/cmd/web
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web')
-rw-r--r--cmd/web/js/api.js10
-rw-r--r--cmd/web/js/main.jsx25
2 files changed, 33 insertions, 2 deletions
diff --git a/cmd/web/js/api.js b/cmd/web/js/api.js
index f892a6b..62530ba 100644
--- a/cmd/web/js/api.js
+++ b/cmd/web/js/api.js
@@ -64,6 +64,16 @@ var ApiEndpoints = {
64 return '/changepassword'; 64 return '/changepassword';
65 } 65 }
66 }, 66 },
67 'CONFIRM_EMAIL': {
68 'type': 'POST',
69 'auth': false,
70 'parameters': [
71 {'name': 'token', 'mandatory': true, 'inquery': true},
72 ],
73 'buildUrl': function() {
74 return '/confirmemail';
75 }
76 },
67 'MARKET': { 77 'MARKET': {
68 'type': 'GET', 78 'type': 'GET',
69 'auth': true, 79 'auth': true,
diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx
index 84b5848..5dc45eb 100644
--- a/cmd/web/js/main.jsx
+++ b/cmd/web/js/main.jsx
@@ -62,6 +62,27 @@ App.page('/change-password', false, function(context) {
62 </div>); 62 </div>);
63}); 63});
64 64
65App.page('/confirm', false, function(context) {
66 var token = qs.parse(context.querystring).token;
67
68 if (token === undefined) {
69 App.go('/');
70 return;
71 }
72
73 Api.Call(
74 'CONFIRM_EMAIL',
75 {'token': token},
76 function(err, status, data) {
77 if (err) {
78 console.error(err, data);
79 }
80
81 App.go('/me');
82 }
83 );
84});
85
65App.page('/signout', true, function(context) { 86App.page('/signout', true, function(context) {
66 cookies.removeItem('jwt'); 87 cookies.removeItem('jwt');
67 88
@@ -84,8 +105,8 @@ App.page('/not_confirmed', true, function(context) {
84 App.mount(<div> 105 App.mount(<div>
85 <div className="row"> 106 <div className="row">
86 <div className="box offset-3 col-6 text-center"> 107 <div className="box offset-3 col-6 text-center">
87 <p>Please be patient, you account is being confirmed...</p> 108 <p>An email has now been sent to your email address.</p>
88 <p><a href="/me"><u>Refresh</u></a></p> 109 <p>Please click the "Confirm your account" button to validate your email.</p>
89 </div> 110 </div>
90 </div> 111 </div>
91 </div>); 112 </div>);