Skip to content
Snippets Groups Projects
Commit 6caf3927 authored by V S Tharunika's avatar V S Tharunika
Browse files

added 'AuthenticationController' file to handle the user input in registration process

parent 351d290d
Branches
No related tags found
No related merge requests found
module.exports={
register(req, res){
const {User}= require('../models')
res.send({
message: 'hello ${req.body.email} ! Your user was registered! Have fun!'
module.exports={
async register(req, res){
try{
const user= await User.create(req.body)
res.send(user.toJSON())
}catch (err){
res.status(400).send({
error: 'This email account is already in use.'
})
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment