Refactor code structure and remove redundant sections for improved readability and maintainability
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 47s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 47s
This commit is contained in:
@@ -27,8 +27,8 @@ const activate = async (req, res, next) => {
|
||||
|
||||
const loginUser = async (req, res, next) => {
|
||||
try {
|
||||
const { email, password } = req.body;
|
||||
const result = await login(email, password);
|
||||
const { email, password, rememberMe } = req.body;
|
||||
const result = await login(email, password, { rememberMe });
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
@@ -37,7 +37,7 @@ const loginUser = async (req, res, next) => {
|
||||
|
||||
const logoutUser = async (req, res, next) => {
|
||||
try {
|
||||
const token = req.headers['authorization']?.split(' ')[1];
|
||||
const token = req.headers['authorization']?.split(' ')[1] || req.headers.authcode;
|
||||
const result = await logout(token);
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user