Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/(auth)/forgot-password/forgot-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { useState } from "react";
import Link from "next/link";
import { getClient } from "@/lib/supabase/lazy-client";
import { captureSupabaseError } from "@/lib/sentry";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
Expand Down Expand Up @@ -36,7 +35,9 @@ export function ForgotPasswordForm() {
});

if (resetError) {
captureSupabaseError(resetError, "forgot-password:resetPasswordForEmail");
import("@/lib/sentry").then(({ captureSupabaseError }) =>
captureSupabaseError(resetError, "forgot-password:resetPasswordForEmail"),
);
setError(resetError.message);
setLoading(false);
return;
Expand Down
5 changes: 3 additions & 2 deletions src/app/(auth)/reset-password/reset-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useState } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import { getClient } from "@/lib/supabase/lazy-client";
import { captureSupabaseError } from "@/lib/sentry";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
Expand Down Expand Up @@ -46,7 +45,9 @@ export function ResetPasswordForm() {
});

if (updateError) {
captureSupabaseError(updateError, "reset-password:updateUser");
import("@/lib/sentry").then(({ captureSupabaseError }) =>
captureSupabaseError(updateError, "reset-password:updateUser"),
);
setError(updateError.message);
setLoading(false);
return;
Expand Down
8 changes: 4 additions & 4 deletions src/components/auth/oauth-buttons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ describe("OAuthButtons — OAuth enabled", () => {
expect(screen.getByRole("alert")).toHaveTextContent(
"Provider not enabled",
);
expect(mockCaptureSupabaseError).toHaveBeenCalledWith(
oauthError,
"oauth.signIn.github",
);
});
expect(mockCaptureSupabaseError).toHaveBeenCalledWith(
oauthError,
"oauth.signIn.github",
);
});

it("disables both buttons while a provider is loading", async () => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/auth/oauth-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { useState } from "react";
import { getClient } from "@/lib/supabase/lazy-client";
import { captureSupabaseError } from "@/lib/sentry";
import { Button } from "@/components/ui/button";
import {
Tooltip,
Expand Down Expand Up @@ -61,7 +60,9 @@ export function OAuthButtons() {
});

if (oauthError) {
captureSupabaseError(oauthError as unknown as Error, `oauth.signIn.${provider}`);
import("@/lib/sentry").then(({ captureSupabaseError }) =>
captureSupabaseError(oauthError as unknown as Error, `oauth.signIn.${provider}`),
);
setError(oauthError.message);
setLoadingProvider(null);
}
Expand Down
Loading