forked from 0x2620/pandora
fix changing email, pandora.validateNewEmail has to pass value to callback
This commit is contained in:
parent
e24f83d4c6
commit
8f3aa15eb4
1 changed files with 7 additions and 4 deletions
|
@ -49,20 +49,23 @@ pandora.validateCode = function(value, callback) {
|
||||||
pandora.validateNewEmail = function(value, callback) {
|
pandora.validateNewEmail = function(value, callback) {
|
||||||
value == pandora.user.email ? callback({
|
value == pandora.user.email ? callback({
|
||||||
message: '',
|
message: '',
|
||||||
valid: true
|
valid: true,
|
||||||
|
value: value
|
||||||
}) : Ox.isValidEmail(value) ? pandora.api.findUser({
|
}) : Ox.isValidEmail(value) ? pandora.api.findUser({
|
||||||
key: 'email',
|
key: 'email',
|
||||||
value: value,
|
value: value,
|
||||||
operator: '=='
|
operator: '=='
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
callback({
|
callback({
|
||||||
message: Ox._('E-Mail Address already exists'),
|
message: !!result.data.users.length ? Ox._('E-Mail Address already exists') : '',
|
||||||
valid: !result.data.users.length
|
valid: !result.data.users.length,
|
||||||
|
value: value
|
||||||
});
|
});
|
||||||
}) : callback({
|
}) : callback({
|
||||||
message: value.length ? Ox._('Invalid e-mail address') : '',
|
message: value.length ? Ox._('Invalid e-mail address') : '',
|
||||||
// message: (!value.length ? 'Missing' : 'Invalid') + ' e-mail address',
|
// message: (!value.length ? 'Missing' : 'Invalid') + ' e-mail address',
|
||||||
valid: false
|
valid: false,
|
||||||
|
value: value
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue