Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Remove console.debug statements from authOptions #55

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions front/src/app/api/auth/[...nextauth]/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const authOptions: NextAuthOptions = {
isNewUser?: boolean;
session?: any;
}) => {
console.debug("JWT Callback", token);
if (user) {
token.role = user.role;
}
Expand All @@ -54,7 +53,6 @@ export const authOptions: NextAuthOptions = {
lock.acquire("refreshToken", async function (done) {
try {
const cachedJsonData = await redis.get("openchokin-" + token.sub as string);
console.debug("Cached data", cachedJsonData);
if (cachedJsonData) {
const cachedData = JSON.parse(cachedJsonData);
const iv = Buffer.from(cachedData.iv, 'hex');
Expand Down Expand Up @@ -86,7 +84,6 @@ export const authOptions: NextAuthOptions = {
expiresAt: token.expiresAt,
iv: iv.toString('hex'),
})
console.debug("New cached data", newCachedData);
await redis.set("openchokin-" + token.sub as string, newCachedData, "EX", 60 * 60 * 24 * 30);
} catch (e) {
console.error("Error refreshing token", e);
Expand All @@ -103,7 +100,6 @@ export const authOptions: NextAuthOptions = {
session.user.role = token.role;
session.user.idToken = token.idToken;
session.user.sub = token.sub;
//console.debug(session);
return session;
},
},
Expand Down