mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
* fix: #546 issue with closing registration * refactor: change casing of controller files for consistency * fix: ensure registrationEnabled is sending a boolean value * refactor: modifications to openId code
This commit is contained in:
parent
fdc5265f48
commit
25211d6f23
16 changed files with 44356 additions and 44376 deletions
21
api/server/controllers/auth/LogoutController.js
Normal file
21
api/server/controllers/auth/LogoutController.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const { logoutUser } = require('../../services/auth.service');
|
||||
|
||||
const logoutController = async (req, res) => {
|
||||
const { signedCookies = {} } = req;
|
||||
const { refreshToken } = signedCookies;
|
||||
try {
|
||||
const logout = await logoutUser(req.user, refreshToken);
|
||||
const { status, message } = logout;
|
||||
res.clearCookie('token');
|
||||
res.clearCookie('refreshToken');
|
||||
return res.status(status).send({ message });
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return res.status(500).json({ message: err.message });
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
logoutController
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue