Skip to content

Commit

Permalink
fix: Send error on create brevo
Browse files Browse the repository at this point in the history
  • Loading branch information
storm1729 committed Dec 26, 2024
1 parent 95ec945 commit dc15947
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/auth/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createClient } from "@/supabase/server";
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { createBrevoContact } from "@/util/brevo";
import { sentryException } from "@/util/sentry";

export async function GET(request: Request) {
// The `/auth/callback` route is required for the server-side auth flow implemented
Expand All @@ -18,8 +19,11 @@ export async function GET(request: Request) {
// On successful sign-up, create a new contact in Brevo.
const { data, error } = await supabase.auth.getUser();
if (!error && data && data.user) {
// Ignore all errors if we can't get the user
await createBrevoContact(data.user);
try {
await createBrevoContact(data.user);
} catch (err) {
sentryException(err);
}
}
}

Expand Down

0 comments on commit dc15947

Please sign in to comment.