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.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
MR fixes
Sara Vieiraf590e5236735
diff --git a/app/routes/auth/github/callback.tsx b/app/routes/auth/github/callback.tsxindex 4cb72c2afc..5d26e4d19c 100644--- a/app/routes/auth/github/callback.tsx+++ b/app/routes/auth/github/callback.tsx@@ -2,7 +2,7 @@ import { LoaderFunction, redirect } from "@remix-run/node";import config from "~/config";import { authenticator } from "~/services/auth.server";import { ensureUserCookie } from "~/shared/session";-import { LOGIN_ERROR_CODES } from "~/shared/session/useLoginErrors";+import { AUTH_PROVIDERS } from "~/shared/session/useLoginErrors";export const loader: LoaderFunction = async ({ request }) => {const { userId } = await ensureUserCookie(request);@@ -11,7 +11,7 @@ export const loader: LoaderFunction = async ({ request }) => {const error_description = url.searchParams.get("error_description");if (error) {return redirect(- `${config.loginPath}?error=${LOGIN_ERROR_CODES.LOGIN_GITHUB}&message=${+ `${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${error_description || error}`);diff --git a/app/shared/session/useLoginErrors.ts b/app/shared/session/useLoginErrors.tsindex 93b9d0f227..e636946546 100644--- a/app/shared/session/useLoginErrors.ts+++ b/app/shared/session/useLoginErrors.ts@@ -1,18 +1,17 @@import { useEffect } from "react";import { useSearchParams } from "react-router-dom";-export const LOGIN_ERROR_CODES = {+export const AUTH_PROVIDERS = {LOGIN_DEV: "login_dev",LOGIN_GITHUB: "login_github",LOGIN_GOOGLE: "login_google",};export const LOGIN_ERROR_MESSAGES = {- [LOGIN_ERROR_CODES.LOGIN_DEV]:- "There has been an issue logging you in with dev",- [LOGIN_ERROR_CODES.LOGIN_GITHUB]:+ [AUTH_PROVIDERS.LOGIN_DEV]: "There has been an issue logging you in with dev",+ [AUTH_PROVIDERS.LOGIN_GITHUB]:"There has been an issue logging you in with Github",- [LOGIN_ERROR_CODES.LOGIN_GOOGLE]:+ [AUTH_PROVIDERS.LOGIN_GOOGLE]:"There has been an issue logging you in with Google",};@@ -21,7 +20,7 @@ export const useLoginErrors = () => {const error = searchParams.get("error");const message = searchParams.get("message");useEffect(() => {- if (error !== null && !!message) {+ if (error !== null && Boolean(message)) {console.log(message);alert(message);@@ -30,14 +29,14 @@ export const useLoginErrors = () => {}switch (error) {- case LOGIN_ERROR_CODES.LOGIN_DEV:- alert(LOGIN_ERROR_MESSAGES[LOGIN_ERROR_CODES.LOGIN_DEV]);+ case AUTH_PROVIDERS.LOGIN_DEV:+ alert(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_DEV]);break;- case LOGIN_ERROR_CODES.LOGIN_GITHUB:- alert(LOGIN_ERROR_MESSAGES[LOGIN_ERROR_CODES.LOGIN_GITHUB]);+ case AUTH_PROVIDERS.LOGIN_GITHUB:+ alert(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GITHUB]);break;- case LOGIN_ERROR_CODES.LOGIN_GOOGLE:- alert(LOGIN_ERROR_MESSAGES[LOGIN_ERROR_CODES.LOGIN_GOOGLE]);+ case AUTH_PROVIDERS.LOGIN_GOOGLE:+ alert(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GOOGLE]);break;default: