Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 49 lines 1.4 kB view raw
1import {useEffect} from 'react' 2import {useNavigation} from '@react-navigation/native' 3 4import {type NavigationProp} from '#/lib/routes/types' 5import {replaceWebLocation} from '#/lib/routes/web' 6import {logger} from '#/logger' 7import {useSessionApi} from '#/state/session' 8import {getWebOAuthClient} from '#/state/session/oauth-web-client' 9import {consumeOAuthReturnUrl} from '#/state/session/oauth-web-return-url' 10 11export function AuthCallback() { 12 const {login} = useSessionApi() 13 const navigation = useNavigation<NavigationProp>() 14 15 useEffect(() => { 16 void (async () => { 17 try { 18 const client = getWebOAuthClient() 19 const result = await client.init() 20 if (result?.session) { 21 await login( 22 { 23 service: '', 24 identifier: '', 25 password: '', 26 oauthSession: result.session, 27 }, 28 'LoginForm', 29 ) 30 } 31 32 const returnUrl = consumeOAuthReturnUrl() 33 if (returnUrl) { 34 replaceWebLocation(returnUrl) 35 return 36 } 37 38 navigation.replace('Home') 39 } catch (e: unknown) { 40 logger.error('OAuth callback failed', { 41 error: e instanceof Error ? e.message : String(e), 42 }) 43 navigation.replace('Home') 44 } 45 })() 46 }, [login, navigation]) 47 48 return null 49}