edit:module:auth:*logout | add single line documentation for logout module
This commit is contained in:
@ -7,14 +7,19 @@ export const deleteUserSessionInCacheAndDBService = async (
|
||||
jwtToken: JWTAuthToken
|
||||
) => {
|
||||
try {
|
||||
// Construct the userId and sessionId from the JWT token
|
||||
const userId = jwtToken.userId;
|
||||
const sessionId = jwtToken.id;
|
||||
|
||||
// Delete the user session from cache and database
|
||||
await deleteUserSessionFromCacheRepo(userId, sessionId);
|
||||
const deleteUserSessionFromDB = await deleteUserSessionFromDBRepo(
|
||||
sessionId
|
||||
);
|
||||
|
||||
return deleteUserSessionFromDB;
|
||||
|
||||
// If the session was not found in the cache or database, throw an error
|
||||
} catch (error) {
|
||||
ErrorForwarder(
|
||||
error,
|
||||
|
||||
Reference in New Issue
Block a user