a a vibe-coded abomination experiment of a fragrance review platform built on the atmosphere. drydown.social

attempt 2

+11 -2
+9
src/auth.ts
··· 47 47 48 48 export async function login(handle: string) { 49 49 const c = await getClient() 50 + 51 + // Find the redirect URI that matches the current origin 52 + // This handles the case where the list has a trailing slash but window.location.origin does not 53 + const currentOrigin = window.location.origin 54 + const redirectUri = clientMetadata.redirect_uris?.find(uri => 55 + uri.startsWith(currentOrigin) || (uri.endsWith('/') && uri.slice(0, -1) === currentOrigin) 56 + ) 57 + 50 58 return await c.signIn(handle, { 51 59 state: undefined, 52 60 prompt: 'login', 61 + redirect_uri: redirectUri as any, // Explicitly pass the matching URI, cast to any to avoid strict type issues 53 62 }) 54 63 } 55 64
+2 -2
src/components/LoginForm.tsx
··· 14 14 try { 15 15 await login(handle) 16 16 // The user will be redirected, so we don't need to do anything else on success 17 - } catch (err) { 17 + } catch (err: any) { 18 18 console.error(err) 19 - setError('Failed to initiate login. Please check the handle.') 19 + setError(err?.message || 'Failed to initiate login. Please check the handle.') 20 20 setLoading(false) 21 21 } 22 22 }