👔 set redis cache and jwt encode

Set session data in Redis to reduce load on the main database and increase the speed of JWT token validation.
This commit is contained in:
2025-08-13 10:48:48 +07:00
parent 6bdd5b6468
commit 1ebcc8d21d
2 changed files with 27 additions and 2 deletions

View File

@ -8,6 +8,19 @@ export const createUserSessionRepository = async (
try {
return await userSessionModel.create({
data,
include: {
user: {
omit: {
password: true,
providerToken: true,
providerPayload: true,
deletedAt: true,
},
include: {
preference: true,
},
},
},
});
} catch (error) {
ErrorForwarder(error);