Skip to content

Commit

Permalink
remove all debug console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartaithan committed Dec 26, 2024
1 parent ae913ce commit fb6ae4d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions components/BoardCardMenu/BoardCardMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ const BoardCardMenu: FC<BoardCardMenuProps> = (props) => {
),
labels: { confirm: "Delete", cancel: "No don't delete it" },
confirmProps: { color: "red" },
onCancel: () => {
console.info("user cancelled delete");
},
onConfirm: handleDelete,
});
};
Expand Down
19 changes: 0 additions & 19 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { NextResponse, type NextMiddleware } from "next/server";
import { type NullableAuthResponse } from "./models/AuthModel";
import { exchangeRefreshTokenForAuthTokens } from "psn-api";
import { cookies } from "next/headers";
import { createClient } from "./utils/supabase/middleware";

const SB_KEY = process.env.NEXT_PUBLIC_SUPABASE_KEY ?? null;
Expand All @@ -20,18 +19,14 @@ export const config = {
const refreshTokens = async (token: string): Promise<NullableAuthResponse> => {
let authorization: NullableAuthResponse = null;
try {
console.info("refresh token", token);
authorization = await exchangeRefreshTokenForAuthTokens(token);
console.info("refreshed auth", authorization);
} catch (error) {
console.error("unable to refresh tokens", error);
}
return authorization;
};

const resetCookies = (res: NextResponse): NextResponse => {
const allCookies = cookies().getAll();
console.info("cookies before reset", JSON.stringify(allCookies));
res.cookies.delete("psn-access-token");
res.cookies.delete("psn-refresh-token");
if (SB_KEY != null) res.cookies.delete(`sb-${SB_KEY}-auth-token`);
Expand Down Expand Up @@ -63,20 +58,6 @@ export const middleware: NextMiddleware = async (req) => {

const isAuth = access_token !== undefined && session != null;

console.info(
"middleware user",
pathname,
session?.user?.email,
session?.expires_at,
req.headers.get("user-agent"),
);
console.info(
"middleware token",
access_token !== undefined ? access_token.slice(-5) : undefined,
refresh_token !== undefined ? refresh_token.slice(-5) : undefined,
refreshed_auth === null,
);

if (!isAuth && isHomePage) {
return resetCookies(res);
}
Expand Down
3 changes: 0 additions & 3 deletions modals/NoteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ const NoteModal: FC<NoteModalProps> = (props) => {
),
labels: { confirm: "Close", cancel: "Cancel" },
confirmProps: { color: "red" },
onCancel: () => {
console.info("user cancelled modal close");
},
onConfirm: () => {
setState((prev) => ({ ...prev, opened: false }));
},
Expand Down
2 changes: 0 additions & 2 deletions utils/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export const getRefreshedCookies = (): string => {
}
const responseCookies = headers().get("set-cookie");
if (responseCookies !== undefined) {
console.info("cookie from request", refreshed);
console.info("cookie from response", responseCookies);
refreshed = `${refreshed}; ${responseCookies}`;
}
return refreshed;
Expand Down

0 comments on commit fb6ae4d

Please sign in to comment.