The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove prefixes
Steven Teyc48b31c630f1
diff --git a/apps/web/app/api/oauth/token/exchange-code-for-token.ts b/apps/web/app/api/oauth/token/exchange-code-for-token.tsindex c64378b317..405d482e87 100644--- a/apps/web/app/api/oauth/token/exchange-code-for-token.ts+++ b/apps/web/app/api/oauth/token/exchange-code-for-token.ts@@ -161,11 +161,9 @@ export const exchangeAuthCodeForToken = async (const accessToken = createToken({length: OAUTH_CONFIG.ACCESS_TOKEN_LENGTH,- prefix: OAUTH_CONFIG.ACCESS_TOKEN_PREFIX,});const refreshToken = createToken({length: OAUTH_CONFIG.REFRESH_TOKEN_LENGTH,- prefix: OAUTH_CONFIG.REFRESH_TOKEN_PREFIX,});const accessTokenExpires = new Date(Date.now() + OAUTH_CONFIG.ACCESS_TOKEN_LIFETIME * 1000,diff --git a/apps/web/app/api/oauth/token/refresh-access-token.ts b/apps/web/app/api/oauth/token/refresh-access-token.tsindex d23ab086ed..90f30153f7 100644--- a/apps/web/app/api/oauth/token/refresh-access-token.ts+++ b/apps/web/app/api/oauth/token/refresh-access-token.ts@@ -126,11 +126,9 @@ export const refreshAccessToken = async (const newAccessToken = createToken({length: OAUTH_CONFIG.ACCESS_TOKEN_LENGTH,- prefix: OAUTH_CONFIG.ACCESS_TOKEN_PREFIX,});const newRefreshToken = createToken({length: OAUTH_CONFIG.REFRESH_TOKEN_LENGTH,- prefix: OAUTH_CONFIG.REFRESH_TOKEN_PREFIX,});const accessTokenExpires = new Date(Date.now() + OAUTH_CONFIG.ACCESS_TOKEN_LIFETIME * 1000,diff --git a/apps/web/lib/api/oauth/constants.ts b/apps/web/lib/api/oauth/constants.tsindex 632e439b3e..56ebb816de 100644--- a/apps/web/lib/api/oauth/constants.ts+++ b/apps/web/lib/api/oauth/constants.ts@@ -13,8 +13,6 @@ export const OAUTH_CONFIG = {// TODO:// Keep it short and simple (Discuss with Steven)CLIENT_SECRET_PREFIX: "dub_app_secret_",- ACCESS_TOKEN_PREFIX: "dub_access_token_",- REFRESH_TOKEN_PREFIX: "dub_refresh_token_",};// These are the scopes an OAuth app can request on behalf of an userdiff --git a/apps/web/lib/api/oauth/utils.ts b/apps/web/lib/api/oauth/utils.tsindex 1ae5fb2c42..1ff4bff33a 100644--- a/apps/web/lib/api/oauth/utils.ts+++ b/apps/web/lib/api/oauth/utils.ts@@ -15,11 +15,11 @@ export const generateCodeChallengeHash = async (codeVerifier: string) => {};export const createToken = ({- prefix,length,+ prefix,}: {- prefix?: string;length: number;+ prefix?: string;}) => {return `${prefix || ""}${randomBytes(length).toString("hex")}`;};