Skip to content

Commit 63aabf1

Browse files
fix: clearer error message for wrong OAuth client secret (HTTP 404)
When Intervals.icu returns 404 'Client and/or secret not found', show an actionable message pointing the user to verify the secret value in their Intervals.icu OAuth app settings rather than showing the raw error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3a3a06a commit 63aabf1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/OAuthCallbackPage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ export const OAuthCallbackPage: React.FC<OAuthCallbackPageProps> = ({ onLogin })
8080
clientLogger.error('OAuth callback handling failed', '', err);
8181
// Provide a specific, actionable message for the most common
8282
// misconfiguration: the server-side client_secret is missing from the build.
83-
const message = raw.includes('client_secret') || raw.includes('not configured')
84-
? "OAuth sign-in is not configured: the OAuth client secret is missing. Set VITE_OAUTH_PROXY_URL (recommended) or VITE_OAUTH_CLIENT_SECRET as a GitHub repository secret and redeploy."
85-
: raw;
83+
const message =
84+
raw.includes('client_secret') || raw.includes('not configured')
85+
? 'OAuth sign-in is not configured: the OAuth client secret is missing. Set VITE_OAUTH_PROXY_URL (recommended) or VITE_OAUTH_CLIENT_SECRET as a GitHub repository secret and redeploy.'
86+
: raw.toLowerCase().includes('client') && raw.toLowerCase().includes('not found')
87+
? 'OAuth sign-in failed: the client ID or client secret is incorrect. Verify the VITE_OAUTH_CLIENT_SECRET value matches the secret shown in your Intervals.icu OAuth app settings (intervals.icu → Settings → Manage App).'
88+
: raw;
8689
setState({ status: 'error', message });
8790
}
8891
};

0 commit comments

Comments
 (0)