Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

FRAMER_API_HOST

Steven Teyca51909dd1c7
diff --git a/apps/web/lib/auth/constants.ts b/apps/web/lib/auth/constants.ts
index ebabd9224a..8290f67bde 100644
--- a/apps/web/lib/auth/constants.ts
+++ b/apps/web/lib/auth/constants.ts
@@ -3,3 +3,8 @@ export const PASSWORD_RESET_TOKEN_EXPIRY = 1 * 60 * 60; // 1 hour
export const MAX_LOGIN_ATTEMPTS = 10;
export const EMAIL_OTP_EXPIRY_IN = 2 * 60; // 2 minutes
+
+export const FRAMER_API_HOST =
+ process.env.NODE_ENV === "production"
+ ? "https://api.framer.com"
+ : "https://api.development.framer.com";
diff --git a/apps/web/lib/auth/options.ts b/apps/web/lib/auth/options.ts
index 964ce21052..54cbe5d3ec 100644
--- a/apps/web/lib/auth/options.ts
+++ b/apps/web/lib/auth/options.ts
@@ -18,6 +18,7 @@ import EmailProvider from "next-auth/providers/email";
import GithubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import { completeProgramApplications } from "../partners/complete-program-applications";
+import { FRAMER_API_HOST } from "./constants";
import {
exceededLoginAttemptsThreshold,
incrementLoginAttempts,
@@ -268,9 +269,9 @@ export const authOptions: NextAuthOptions = {
clientId: process.env.FRAMER_CLIENT_ID,
clientSecret: process.env.FRAMER_CLIENT_SECRET,
checks: ["state"],
- authorization: "https://api.development.framer.com/auth/oauth/authorize",
- token: "https://api.development.framer.com/auth/oauth/token",
- userinfo: "https://api.development.framer.com/auth/oauth/profile",
+ authorization: `${FRAMER_API_HOST}/auth/oauth/authorize`,
+ token: `${FRAMER_API_HOST}/auth/oauth/token`,
+ userinfo: `${FRAMER_API_HOST}/auth/oauth/profile`,
profile({ sub, email, name, picture }) {
return {
id: sub,