Sifa professional network frontend (Next.js, React, TailwindCSS) sifa.id/

fix(login): show friendly message for upstream OAuth failures (#300)

Display a user-friendly error when redirected back with ?error=upstream
after a transient identity provider failure, instead of showing nothing.

authored by

Guido X Jansen and committed by
GitHub
ded6cb0d 20f2729c

+4 -2
+2 -1
src/app/(main)/login/page.tsx
··· 15 15 16 16 const [handle, setHandle] = useState(''); 17 17 const [isSubmitting, setIsSubmitting] = useState(false); 18 - const [error, setError] = useState<string | null>(null); 18 + const upstreamError = searchParams.get('error') === 'upstream' ? t('errorUpstream') : null; 19 + const [error, setError] = useState<string | null>(upstreamError); 19 20 20 21 useEffect(() => { 21 22 if (session && !isLoading) {
+2 -1
src/i18n/locales/en.json
··· 299 299 "submitting": "Signing in...", 300 300 "errorHandleNotFound": "Could not find an account for \"{handle}\". Enter your full handle including the domain (e.g. \"jay.bsky.social\" or \"alice.custom-pds.example\"). A username alone (e.g. \"jay\") only works for Bluesky accounts.", 301 301 "errorGeneric": "Failed to sign in. Please check your handle and try again.", 302 - "errorNetwork": "Network error. Please try again." 302 + "errorNetwork": "Network error. Please try again.", 303 + "errorUpstream": "Sign-in failed due to a temporary issue with the identity provider. Please try again." 303 304 }, 304 305 "about": { 305 306 "title": "About Sifa",