Merge branch 'master' of github.com:qndydyhm/sbuhacks
This commit is contained in:
commit
eba9846e60
|
@ -15,6 +15,15 @@ loginUser = async (req, res) => {
|
||||||
return await assert("login", req, res);
|
return await assert("login", req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logoutUser = async (req, res) => {
|
||||||
|
return await res.cookie("token", '', {
|
||||||
|
httpOnly: true,
|
||||||
|
secure: true,
|
||||||
|
sameSite: "lax"
|
||||||
|
}).status(200).json({
|
||||||
|
success: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const assert = async (queueName, req, res) => {
|
const assert = async (queueName, req, res) => {
|
||||||
amqp.connect(rabbitMQ, function (error0, connection) {
|
amqp.connect(rabbitMQ, function (error0, connection) {
|
||||||
|
@ -75,4 +84,5 @@ const assert = async (queueName, req, res) => {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
registerUser,
|
registerUser,
|
||||||
loginUser,
|
loginUser,
|
||||||
|
logoutUser,
|
||||||
}
|
}
|
|
@ -4,5 +4,6 @@ const UserAPI = require('../apis/user-apis')
|
||||||
|
|
||||||
router.post('/login', UserAPI.loginUser)
|
router.post('/login', UserAPI.loginUser)
|
||||||
router.post('/register', UserAPI.registerUser)
|
router.post('/register', UserAPI.registerUser)
|
||||||
|
router.get('/logout', UserAPI.logoutUser)
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
Loading…
Reference in New Issue
Block a user