Skip to content

Commit

Permalink
Remove more sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-sherman committed Nov 28, 2024
1 parent 57b022f commit 57d4b43
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 63 deletions.
3 changes: 0 additions & 3 deletions packages/frontpage/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.env.sentry-build-plugin
27 changes: 0 additions & 27 deletions packages/frontpage/app/global-error.tsx

This file was deleted.

55 changes: 26 additions & 29 deletions packages/frontpage/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { db } from "./db";
import * as schema from "./schema";
import { eq } from "drizzle-orm";
import { getDidFromHandleOrDid } from "./data/atproto/identity";
import { startSpan } from "@sentry/nextjs";

const USER_AGENT = "appview/@frontpage.fyi (@tom-sherman.com)";

Expand Down Expand Up @@ -383,39 +382,37 @@ export async function signOut() {
.where(eq(schema.OauthSession.sessionId, session.user.sessionId));
}

export const getSession = cache(() =>
startSpan({ name: "getSession" }, async () => {
const tokenCookie = (await cookies()).get(AUTH_COOKIE_NAME);
if (!tokenCookie) {
return null;
}
export const getSession = cache(async () => {
const tokenCookie = (await cookies()).get(AUTH_COOKIE_NAME);
if (!tokenCookie) {
return null;
}

let token;
try {
token = await jwtVerify(tokenCookie.value, await getPublicJwk());
} catch (e) {
console.error("Failed to verify token", e);
return null;
}
let token;
try {
token = await jwtVerify(tokenCookie.value, await getPublicJwk());
} catch (e) {
console.error("Failed to verify token", e);
return null;
}

if (!token.payload.jti) {
return null;
}
if (!token.payload.jti) {
return null;
}

const [session] = await db
.select()
.from(schema.OauthSession)
.where(eq(schema.OauthSession.sessionId, Number(token.payload.jti)));
const [session] = await db
.select()
.from(schema.OauthSession)
.where(eq(schema.OauthSession.sessionId, Number(token.payload.jti)));

if (!session) {
return null;
}
if (!session) {
return null;
}

return {
user: session,
};
}),
);
return {
user: session,
};
});

export async function importDpopJwks({
privateJwk,
Expand Down
4 changes: 0 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
"VERCEL_ENV",
"CRON_SECRET",
"NEXT_RUNTIME",
"SENTRY_AUTH_TOKEN",
"VERCEL_GIT_COMMIT_SHA",
"SENTRY_PROJECT",
"SENTRY_ORG",
"NEXT_PUBLIC_SENTRY_DSN",
"PLC_DIRECTORY_URL"
]
},
Expand Down

0 comments on commit 57d4b43

Please sign in to comment.