Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow verify login by id

  • Loading branch information...
commit 9bd9ac87d053e9c1c5977e3a84f4acb11e4fd945 1 parent e958d93
@lsm lsm authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  app/account/account.js
  2. +3 −1 app/account/model.js
View
3  app/account/account.js
@@ -199,7 +199,8 @@ var AccountApp = App('AccountApp', {
apiUpdatePassword:function (params) {
var session = this.session;
var self = this;
- var id = Number(params.id);
+ params.id = Number(params.id);
+ var id = params.id;
if (session.id === id || session.groups.indexOf('admin') > -1) {
this.app.loginVerify(params, function (err, doc) {
if (!err && doc) {
View
4 app/account/model.js
@@ -65,7 +65,9 @@ var AccountModel = Model('AccountModel', {
isValidLogin: function () {
if (!this.attr('password')) return false;
var loginInfo;
- if (this.attr('email')) {
+ if (this.attr('id')) {
+ loginInfo = this.toDoc(['id', 'password']);
+ } else if (this.attr('email')) {
loginInfo = {
email: this.attr('email'),
password: this.attr('password')
Please sign in to comment.
Something went wrong with that request. Please try again.