Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

return sentry errors

Sara Vieira4892c1257963
diff --git a/app/routes/auth/github.tsx b/app/routes/auth/github.tsx
index f49cbdbed7..90687739eb 100644
--- a/app/routes/auth/github.tsx
+++ b/app/routes/auth/github.tsx
@@ -1,6 +1,7 @@
import { ActionFunction, redirect } from "@remix-run/node";
import config from "~/config";
import { authenticator } from "~/services/auth.server";
+import { sentryException } from "~/shared/sentry";
import { ensureUserCookie } from "~/shared/session";
import { AUTH_PROVIDERS } from "~/shared/session/useLoginErrors";
@@ -22,7 +23,12 @@ export const action: ActionFunction = async ({ request }) => {
// all redirects are basically errors and in that case we don't want to catch it
if (error instanceof Response) return error;
if (error instanceof Error) {
- console.log(error);
+ sentryException({
+ message: error.message,
+ extra: {
+ loginMethod: "github",
+ },
+ });
return redirect(
`${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${
error?.message || ""
diff --git a/app/routes/auth/google.tsx b/app/routes/auth/google.tsx
index f6ef060045..566bc653c6 100644
--- a/app/routes/auth/google.tsx
+++ b/app/routes/auth/google.tsx
@@ -1,6 +1,7 @@
import { ActionFunction, LoaderFunction, redirect } from "@remix-run/node";
import config from "~/config";
import { authenticator } from "~/services/auth.server";
+import { sentryException } from "~/shared/sentry";
import { ensureUserCookie } from "~/shared/session";
import { AUTH_PROVIDERS } from "~/shared/session/useLoginErrors";
@@ -24,7 +25,12 @@ export const action: ActionFunction = async ({ request }) => {
// all redirects are basically errors and in that case we don't want to catch it
if (error instanceof Response) return error;
if (error instanceof Error) {
- console.log(error);
+ sentryException({
+ message: error.message,
+ extra: {
+ loginMethod: "google",
+ },
+ });
return redirect(
`${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GOOGLE}&message=${
error?.message || ""
diff --git a/app/shared/session/useLoginErrors.ts b/app/shared/session/useLoginErrors.ts
index e636946546..7cd9042e89 100644
--- a/app/shared/session/useLoginErrors.ts
+++ b/app/shared/session/useLoginErrors.ts
@@ -1,5 +1,6 @@
import { useEffect } from "react";
import { useSearchParams } from "react-router-dom";
+import { sentryException } from "../sentry";
export const AUTH_PROVIDERS = {
LOGIN_DEV: "login_dev",
@@ -21,7 +22,9 @@ export const useLoginErrors = () => {
const message = searchParams.get("message");
useEffect(() => {
if (error !== null && Boolean(message)) {
- console.log(message);
+ sentryException({
+ message,
+ });
alert(message);
setSearchParams({});