websockets implemented
This commit is contained in:
@@ -2,8 +2,7 @@ import User from '../models/community/user.js';
|
||||
import { updateUserTimestamp } from '../utils/redis.js';
|
||||
|
||||
export const authenticate = async (req, res, next) => {
|
||||
const userId = req.headers.userid;
|
||||
const authCode = req.headers.authcode;
|
||||
const { userid: userId, authcode: authCode } = req.headers;
|
||||
if (!userId || !authCode) {
|
||||
return res.status(401).json({ error: 'Unauthorized: Missing credentials' });
|
||||
}
|
||||
@@ -12,7 +11,7 @@ export const authenticate = async (req, res, next) => {
|
||||
return res.status(401).json({ error: 'Unauthorized: Invalid credentials' });
|
||||
}
|
||||
try {
|
||||
await updateUserTimestamp(userId);
|
||||
await updateUserTimestamp(user.id);
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Aktualisieren des Zeitstempels:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user