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.

small PR fixes

Sara Vieira6fe2ea1b1126
diff --git a/app/config.ts b/app/config.ts
index 799e8135ad..7bc8840d93 100644
--- a/app/config.ts
+++ b/app/config.ts
@@ -7,6 +7,7 @@ const config = {
logoutPath: "/logout",
googleCallbackPath: "/google/callback",
githubCallbackPath: "/github/callback",
+ authPath: "/auth",
};
export default config;
export type Config = typeof config;
diff --git a/app/routes/logout.tsx b/app/routes/logout.tsx
index a761b0f04b..3a81f6b2cf 100644
--- a/app/routes/logout.tsx
+++ b/app/routes/logout.tsx
@@ -1,4 +1,5 @@
import { ActionFunction } from "@remix-run/node";
+import config from "~/config";
import { authenticator } from "~/services/auth.server";
export default function Login() {
@@ -6,5 +7,5 @@ export default function Login() {
}
export const loader: ActionFunction = async ({ request }) => {
- await authenticator.logout(request, { redirectTo: "/login" });
+ await authenticator.logout(request, { redirectTo: config.loginPath });
};
diff --git a/app/services/auth.server.ts b/app/services/auth.server.ts
index 69fd994314..522a1b592c 100644
--- a/app/services/auth.server.ts
+++ b/app/services/auth.server.ts
@@ -13,13 +13,13 @@ const url = `${
process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: `http://localhost:${process.env.PORT || 3000}`
-}/auth`;
+}${config.authPath}`;
const github = new GitHubStrategy(
{
clientID: process.env.GH_CLIENT_ID as string,
clientSecret: process.env.GH_CLIENT_SECRET as string,
- callbackURL: `${url}${config.githubCallback}`,
+ callbackURL: `${url}${config.githubCallbackPath}`,
},
async ({ profile, context }) => {
const user = await createOrLoginWithGithub(profile, context?.userId);
@@ -32,7 +32,7 @@ const google = new GoogleStrategy(
{
clientID: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
- callbackURL: `${url}${config.googleCallback}`,
+ callbackURL: `${url}${config.googleCallbackPath}`,
},
async ({ profile, context }) => {
const user = await createOrLoginWithGoogle(profile, context?.userId);