Skip to content

Commit

Permalink
Merge pull request #55 from walnuts1018/refactoring
Browse files Browse the repository at this point in the history
Remove console.debug statements from authOptions
  • Loading branch information
walnuts1018 authored Nov 7, 2023
2 parents 5e0b642 + 3f8f546 commit 6e9bf3a
Showing 1 changed file with 0 additions and 4 deletions.
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

0 comments on commit 6e9bf3a

Please sign in to comment.