forked from 0x2620/pandora
fix a bug with resetting passwords
This commit is contained in:
parent
b682055a33
commit
4266c4578b
3 changed files with 10 additions and 7 deletions
|
@ -192,7 +192,7 @@ def resetPassword(request):
|
||||||
status: {'code': int, 'text': string}
|
status: {'code': int, 'text': string}
|
||||||
data: {
|
data: {
|
||||||
errors: {
|
errors: {
|
||||||
code: 'Invalid Code'
|
code: 'Incorrect Code'
|
||||||
}
|
}
|
||||||
user {
|
user {
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ def resetPassword(request):
|
||||||
else:
|
else:
|
||||||
response = json_response({
|
response = json_response({
|
||||||
'errors': {
|
'errors': {
|
||||||
'code': 'Invalid code'
|
'code': 'Incorrect code'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||||
|
|
||||||
pandora.autovalidateCode = function(value, blur, callback) {
|
pandora.autovalidateCode = function(value, blur, callback) {
|
||||||
value = value.split('').map(function(v) {
|
value = value.toUpperCase().split('').map(function(v) {
|
||||||
return /[A-Z]/.test(v) ? v : null;
|
return /[A-Z]/.test(v) ? v : null;
|
||||||
}).join('').substr(0, 16);
|
}).join('').substr(0, 16);
|
||||||
callback({valid: value.length == 16, value: value});
|
callback({valid: value.length == 16, value: value});
|
||||||
|
|
|
@ -31,7 +31,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
|
||||||
signin: 'Sign In',
|
signin: 'Sign In',
|
||||||
signup: 'Sign Up',
|
signup: 'Sign Up',
|
||||||
reset: 'Reset Password',
|
reset: 'Reset Password',
|
||||||
resetAndSignin: 'Reset Password and Sign In'
|
resetAndSignin: 'Sign In'
|
||||||
},
|
},
|
||||||
dialogText = {
|
dialogText = {
|
||||||
signin: 'To sign in to your account, please enter your username and password.',
|
signin: 'To sign in to your account, please enter your username and password.',
|
||||||
|
@ -67,16 +67,19 @@ pandora.ui.accountDialogOptions = function(action, value) {
|
||||||
id: type,
|
id: type,
|
||||||
title: buttonTitle[type] + '...'
|
title: buttonTitle[type] + '...'
|
||||||
}).bindEvent('click', function() {
|
}).bindEvent('click', function() {
|
||||||
//Ox.print('CLICK EVENT', type)
|
|
||||||
pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type));
|
pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
buttons: Ox.merge(buttons[action].map(function(type) {
|
buttons: Ox.merge(
|
||||||
|
buttons[action].map(function(type) {
|
||||||
return button(type);
|
return button(type);
|
||||||
}), [{}, button('cancel'), button('submit')]),
|
}),
|
||||||
|
buttons[action].length ? [{}] : [],
|
||||||
|
[button('cancel'), button('submit')]
|
||||||
|
),
|
||||||
content: Ox.Element()
|
content: Ox.Element()
|
||||||
.append(
|
.append(
|
||||||
$('<img>')
|
$('<img>')
|
||||||
|
|
Loading…
Reference in a new issue