Last active
January 21, 2022 08:01
-
-
Save adityawibisana/ffb65a8475eae0a262e6e4259c2ea109 to your computer and use it in GitHub Desktop.
Medium Sails - Normal UserController for login and register
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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