more stuff on pw reset

v1.18.x
Julian Lam 12 years ago
parent 9fcbca8da9
commit e56e7b549b

@ -5,7 +5,7 @@ var socket,
(function() {
$.ajax({
url: 'config.json?v=' + new Date().getTime(),
url: '/config.json?v=' + new Date().getTime(),
success: function(data) {
config = data;
socket = io.connect('http://' + config.socket.address + config.socket.port? ':' + config.socket.port : '');

@ -5,7 +5,7 @@ function loadTemplates(templatesToLoad) {
for (var t in templatesToLoad) {
(function(template) {
$.get('templates/' + template + '.tpl?v=' + timestamp, function(html) {
$.get('/templates/' + template + '.tpl?v=' + timestamp, function(html) {
templates[template] = html;
});
}(templatesToLoad[t]));

@ -3,13 +3,13 @@
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="socket.io/socket.io.js"></script>
<script type="text/javascript" src="src/app.js"></script>
<script type="text/javascript" src="src/templates.js"></script>
<script type="text/javascript" src="src/ajaxify.js"></script>
<script type="text/javascript" src="/vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="/src/app.js"></script>
<script type="text/javascript" src="/src/templates.js"></script>
<script type="text/javascript" src="/src/ajaxify.js"></script>
<style type="text/css">
body {
padding-top: 60px;

@ -0,0 +1,26 @@
<h1>Reset Password</h1>
<div class="well">
<div class="alert alert-success" id="success" style="display:none">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Password Changed</strong>
<p></p>
</div>
<label>New Password</label><input type="password" placeholder="A new password" id="password" /><br />
<label>... and again</label><input type="password" placeholder="" id="password_2" /><br />
<input type="hidden" value="{andrew - the code goes here}" />
<button class="btn btn-primary" id="reset" type="submit">Reset Password</button>
</div>
<script type="text/javascript">
(function() {
var resetEl = document.getElementById('reset');
resetEl.addEventListener('click', function() {
}, false);
// socket.on('user.password.reset', function(data) {
// if (data.success === 'ok') {
// ajaxify.go('/');
// }
// });
}());
</script>

@ -15,7 +15,7 @@ var fs = require('fs');
}
Templates.init = function() {
loadTemplates(['header', 'footer', 'register', 'home', 'login', 'reset']);
loadTemplates(['header', 'footer', 'register', 'home', 'login', 'reset', 'reset_code']);
}
}(exports));

@ -24,6 +24,11 @@ var express = require('express'),
res.send(templates['header'] + templates['login'] + templates['footer']);
});
app.get('/reset/:code', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['reset_code'] + templates['footer']);
});
app.get('/reset', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['reset'] + templates['footer']);

Loading…
Cancel
Save