Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
agrattan0820 committed Apr 7, 2024
2 parents 32cf0ac + 18d411c commit dc92f75
Show file tree
Hide file tree
Showing 4 changed files with 1,185 additions and 1,065 deletions.
8 changes: 4 additions & 4 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"autoprefixer": "10.4.17",
"clsx": "^2.1.0",
"database": "workspace:*",
"drizzle-orm": "^0.29.3",
"framer-motion": "^11.0.3",
"next": "^14.1.0",
"drizzle-orm": "^0.30.7",
"framer-motion": "^11.0.25",
"next": "^14.1.4",
"next-auth": "^4.24.5",
"postcss": "8.4.35",
"postcss": "8.4.38",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
Expand Down
8 changes: 1 addition & 7 deletions apps/client/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ Sentry.init({
replaysSessionSampleRate: 0.1,

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
// Additional Replay configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
integrations: [Sentry.replayIntegration()],
});
19 changes: 16 additions & 3 deletions apps/client/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import NextAuth, { NextAuthOptions } from "next-auth";
import GoogleProvider from "next-auth/providers/google";
import { db } from "database";
import { myDrizzleAdapter } from "@ai/components/my-drizzle-adapter";
import { captureMessage } from "@sentry/nextjs";

export const authOptions = (
req?: NextApiRequest | Request,
Expand All @@ -13,16 +14,28 @@ export const authOptions = (
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID ?? "",
clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "",
checks: ["none"],
profile(profile) {
const cookieNickname =
req && "cookies" in req && typeof req.cookies === "object"
? typeof req.cookies["next-auth.callback-url"] === "string"
? new URL(
req.cookies["next-auth.callback-url"],
).searchParams.get("nickname") ?? ""
: ""
: typeof req.cookies["__Secure-next-auth.callback-url"] ===
"string"
? new URL(
req.cookies["__Secure-next-auth.callback-url"],
).searchParams.get("nickname") ?? ""
: ""
: "";

if (!cookieNickname) {
captureMessage(
"No nickname was found when returning profile from Google callback.",
);
}

return {
id: profile.sub,
name: profile.name,
Expand All @@ -36,14 +49,14 @@ export const authOptions = (
}),
],
pages: {
signIn: "/auth",
signIn: "/sign-in",
// signOut: "/auth/signout",
// error: "/auth/error", // Error code passed in query string as ?error=
// verifyRequest: "/auth/verify-request", // (used for check email message)
// newUser: "/auth/new-user", // New users will be directed here on first sign in (leave the property out if not of interest)
},
callbacks: {
async session({ session, user }) {
session({ session, user }) {
session.user = user;
return session;
},
Expand Down
Loading

0 comments on commit dc92f75

Please sign in to comment.