{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1556","labels_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1556/labels{/name}","comments_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1556/comments","events_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1556/events","html_url":"https://github.com/angular-fullstack/generator-angular-fullstack/issues/1556","id":126383188,"number":1556,"title":"Sequelize update/save not working","user":{"login":"daniel7912","id":5707575,"avatar_url":"https://avatars.githubusercontent.com/u/5707575?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel7912","html_url":"https://github.com/daniel7912","followers_url":"https://api.github.com/users/daniel7912/followers","following_url":"https://api.github.com/users/daniel7912/following{/other_user}","gists_url":"https://api.github.com/users/daniel7912/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel7912/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel7912/subscriptions","organizations_url":"https://api.github.com/users/daniel7912/orgs","repos_url":"https://api.github.com/users/daniel7912/repos","events_url":"https://api.github.com/users/daniel7912/events{/privacy}","received_events_url":"https://api.github.com/users/daniel7912/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-13T10:03:45Z","updated_at":"2016-01-13T10:03:45Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying to separate out the auth/local code a bit more and have created a new file, local.controller.js which contains all of the route functions. The problem I have is that inside this local.controller.js file, model.find(), model.destroy() and model.count() all seem to work fine, but when I try model.update() or model.save(), express crashes without returning any errors. The 'beforeUpdate' hook is not called either.\r\n\r\nHere is my code:\r\n\r\nauth/local/index.ks\r\n\r\n`'use strict';\r\n\r\nimport express from 'express';\r\nimport * as controller from './local.controller';\r\nvar router = express.Router();\r\n\r\nrouter.post('/', controller.authenticate);\r\nrouter.post('/reset-password', controller.resetPassword);\r\n\r\nexport default router;`\r\n\r\nauth/local/local.controller.js\r\n\r\n`'use strict';\r\n\r\nimport config from '../../config/environment';\r\nimport mail from '../../mail';\r\nimport jwt from 'jsonwebtoken';\r\nimport expressJwt from 'express-jwt';\r\nimport passport from 'passport';\r\nimport {User} from '../../sqldb';\r\nimport {signToken} from '../auth.service';\r\n\r\nexport function authenticate(req, res, next) {\r\n\r\n  passport.authenticate('local', function(err, user, info) {\r\n    var error = err || info;\r\n    if (error) {\r\n      return res.status(401).json(error);\r\n    }\r\n    if (!user) {\r\n      return res.status(404).json({message: 'Something went wrong, please try again.'});\r\n    }\r\n\r\n    var token = signToken(user._id, user.role);\r\n    res.json({ token });\r\n  })(req, res, next)\r\n\r\n};\r\n\r\nexport function resetPassword(req, res, next) {\r\n\r\n  var passwordResetToken = String(req.body.passwordResetToken);\r\n  var newPassword = String(req.body.password);\r\n\r\n  jwt.verify(passwordResetToken, config.secrets.forgotPassword, function(err, data) {\r\n\r\n    if (err) {\r\n      console.log(err);\r\n      return res.status(403).json({message: 'Invalid token.'});\r\n    }\r\n\r\n    User.find({\r\n      where: {\r\n        email: 'testuser@test.com'\r\n      }\r\n    }).then(function(user) {\r\n\r\n      user.password = newPassword;\r\n\r\n      return user.save().then(function() {\r\n        console.log('success');\r\n        res.json({message: 'Password reset successfully.'});\r\n      })\r\n      .catch(function(err) {\r\n        console.log(err);\r\n      });\r\n\r\n    }).catch(function(err) {\r\n      console.log(err);\r\n    });\r\n\r\n  });\r\n\r\n};`\r\n\r\nThe JWT verifies OK, then the user is found OK, lets me update the user.password value OK, but crashes at the save() function.\r\n\r\nCould someone tell me where I'm going wrong please?\r\n\r\nThanks for any help."}}