rp
04/26/2021, 4:59 AMconst createSession = async (res, userId) => {
try {
console.log(userId)
let session = await Session
.createNewSession(res, userId);
console.log(session);
} catch (error) {
console.log(error);
throw error
}
}
const signIn = (req, res) => {
const { email, password } = req.body
ThirdPartyEmailPassword
.signIn(email, password)
.then(async u => {
try {
await createSession(res, u.id)
res.json(u)
} catch (err) {
res.status(500).json(e.message)
}
}).catch(error => {
res.status(500).json(error)
})
}