diff --git a/packages/ui/docs-bundle/src/pages/api/fern-docs/auth/jwt/callback.ts b/packages/ui/docs-bundle/src/pages/api/fern-docs/auth/jwt/callback.ts index 9e9205b7ca..0ec2ba6c46 100644 --- a/packages/ui/docs-bundle/src/pages/api/fern-docs/auth/jwt/callback.ts +++ b/packages/ui/docs-bundle/src/pages/api/fern-docs/auth/jwt/callback.ts @@ -27,6 +27,8 @@ export default async function handler(req: NextRequest): Promise { const redirectLocation = state ?? `https://${domain}/`; if (edgeConfig?.type !== "basic_token_verification" || token == null) { + // eslint-disable-next-line no-console + console.error(`Invalid config for domain ${domain}`); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } diff --git a/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/ory/callback.ts b/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/ory/callback.ts index fda45f531e..f956dc7555 100644 --- a/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/ory/callback.ts +++ b/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/ory/callback.ts @@ -29,16 +29,22 @@ export default async function GET(req: NextRequest): Promise { const redirectLocation = state ?? `https://${domain}/`; if (error != null) { + // eslint-disable-next-line no-console + console.error(`OAuth2 error: ${error} - ${error_description}`); return redirectWithLoginError(redirectLocation, error_description ?? error); } if (typeof code !== "string") { + // eslint-disable-next-line no-console + console.error("Missing code in query params"); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } const config = await getAuthEdgeConfig(domain); if (config == null || config.type !== "oauth2" || config.partner !== "ory") { + // eslint-disable-next-line no-console + console.log(`Invalid config for domain ${domain}`); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } @@ -64,7 +70,7 @@ export default async function GET(req: NextRequest): Promise { return res; } catch (error) { // eslint-disable-next-line no-console - console.error(error); + console.error("Error getting access token", error); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } } diff --git a/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/webflow/callback.ts b/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/webflow/callback.ts index 90548246fa..b8ec8d64bc 100644 --- a/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/webflow/callback.ts +++ b/packages/ui/docs-bundle/src/pages/api/fern-docs/oauth/webflow/callback.ts @@ -26,16 +26,22 @@ export default async function GET(req: NextRequest): Promise { const redirectLocation = state ?? `https://${domain}/`; if (error != null) { + // eslint-disable-next-line no-console + console.error(`OAuth2 error: ${error} - ${error_description}`); return redirectWithLoginError(redirectLocation, error_description ?? error); } if (typeof code !== "string") { + // eslint-disable-next-line no-console + console.error("Missing code in query params"); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } const config = await getAuthEdgeConfig(domain); - if (config == null || config.type !== "oauth2" || config.partner === "ory") { + if (config == null || config.type !== "oauth2" || config.partner === "webflow") { + // eslint-disable-next-line no-console + console.log(`Invalid config for domain ${domain}`); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } @@ -52,7 +58,7 @@ export default async function GET(req: NextRequest): Promise { return res; } catch (error) { // eslint-disable-next-line no-console - console.error(error); + console.error("Error getting access token", error); return redirectWithLoginError(redirectLocation, "Couldn't login, please try again"); } }