Skip to content

Instantly share code, notes, and snippets.

@adityawibisana
Last active January 21, 2022 08:01
Show Gist options
  • Save adityawibisana/ffb65a8475eae0a262e6e4259c2ea109 to your computer and use it in GitHub Desktop.
Save adityawibisana/ffb65a8475eae0a262e6e4259c2ea109 to your computer and use it in GitHub Desktop.
Medium Sails - Normal UserController for login and register
module.exports = {
register: (req, res) => {
if (!req.param("username")) {
return res.status(400).send({
code: 1,
message: `'username' parameter is needed`
})
}
... continue processing registration
},
login: (req, res) => {
if (!req.param("username")) {
return res.status(400).send({
code: 1,
message: `'username' parameter is needed`
})
}
... continue processing login
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment