hacking
This commit is contained in:
@@ -223,6 +223,7 @@ func serve(cctx *cli.Context) error {
|
|||||||
e.GET("/intent/compose", server.WebGeneric)
|
e.GET("/intent/compose", server.WebGeneric)
|
||||||
e.GET("/messages", server.WebGeneric)
|
e.GET("/messages", server.WebGeneric)
|
||||||
e.GET("/messages/:conversation", server.WebGeneric)
|
e.GET("/messages/:conversation", server.WebGeneric)
|
||||||
|
e.GET("/auth/callback", server.WebGeneric)
|
||||||
|
|
||||||
// profile endpoints; only first populates info
|
// profile endpoints; only first populates info
|
||||||
e.GET("/profile/:handleOrDID", server.WebProfile)
|
e.GET("/profile/:handleOrDID", server.WebProfile)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"client_id": "https://bsky.app/.well-known/client-metadata.json",
|
"client_id": "https://.ngrok-free.app/.well-known/client-metadata.json",
|
||||||
"client_name": "Bluesky",
|
"client_name": "Bluesky",
|
||||||
"client_uri": "https://bsky.app",
|
"client_uri": "https://.ngrok-free.app",
|
||||||
"logo_uri": "https://bsky.app/logo.png",
|
"logo_uri": "https://bsky.app/logo.png",
|
||||||
"tos_uri": "https://bsky.social/about/support/tos",
|
"tos_uri": "https://bsky.social/about/support/tos",
|
||||||
"policy_uri": "https://bsky.social/about/support/privacy-policy",
|
"policy_uri": "https://bsky.social/about/support/privacy-policy",
|
||||||
"redirect_uris": ["https://bsky.app/auth/callback"],
|
"redirect_uris": ["https://.ngrok-free.app/auth/callback"],
|
||||||
"scope": "profile email offline_access",
|
"scope": "profile email offline_access",
|
||||||
"grant_types": ["authorization_code", "refresh_token"],
|
"grant_types": ["authorization_code", "refresh_token"],
|
||||||
"response_types": ["code"],
|
"response_types": ["code"],
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import {PreferencesThreads} from 'view/screens/PreferencesThreads'
|
|||||||
import {SavedFeeds} from 'view/screens/SavedFeeds'
|
import {SavedFeeds} from 'view/screens/SavedFeeds'
|
||||||
import {SharedPreferencesTesterScreen} from '#/screens/E2E/SharedPreferencesTesterScreen'
|
import {SharedPreferencesTesterScreen} from '#/screens/E2E/SharedPreferencesTesterScreen'
|
||||||
import HashtagScreen from '#/screens/Hashtag'
|
import HashtagScreen from '#/screens/Hashtag'
|
||||||
|
import {CallbackScreen} from '#/screens/Login/CallbackScreen'
|
||||||
import {ModerationScreen} from '#/screens/Moderation'
|
import {ModerationScreen} from '#/screens/Moderation'
|
||||||
import {ProfileKnownFollowersScreen} from '#/screens/Profile/KnownFollowers'
|
import {ProfileKnownFollowersScreen} from '#/screens/Profile/KnownFollowers'
|
||||||
import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy'
|
import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy'
|
||||||
@@ -364,6 +365,11 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
|
|||||||
getComponent={() => Wizard}
|
getComponent={() => Wizard}
|
||||||
options={{title: title(msg`Edit your starter pack`), requireAuth: true}}
|
options={{title: title(msg`Edit your starter pack`), requireAuth: true}}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="AuthCallback"
|
||||||
|
getComponent={() => CallbackScreen}
|
||||||
|
options={{title: title(msg`Callback`)}}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export type CommonNavigatorParams = {
|
|||||||
StarterPackShort: {code: string}
|
StarterPackShort: {code: string}
|
||||||
StarterPackWizard: undefined
|
StarterPackWizard: undefined
|
||||||
StarterPackEdit: {rkey?: string}
|
StarterPackEdit: {rkey?: string}
|
||||||
|
AuthCallback: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BottomTabNavigatorParams = CommonNavigatorParams & {
|
export type BottomTabNavigatorParams = CommonNavigatorParams & {
|
||||||
|
|||||||
@@ -1,7 +1,31 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import {AppBskyActorDefs} from '@atproto/api'
|
||||||
|
|
||||||
import {ListMaybePlaceholder} from '#/components/Lists'
|
import {CenteredView} from 'view/com/util/Views'
|
||||||
|
import {client} from '#/screens/Login/LoginForm'
|
||||||
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
export function CallbackScreen() {
|
export function CallbackScreen() {
|
||||||
return <ListMaybePlaceholder isLoading={true} />
|
const [profile, setProfile] = React.useState<AppBskyActorDefs.ProfileView>()
|
||||||
|
React.useEffect(() => {
|
||||||
|
;(async () => {
|
||||||
|
const res = await client.init()
|
||||||
|
const profileRes = await res!.agent.request(
|
||||||
|
'/xrpc/com.atproto.repo.getRecord?' +
|
||||||
|
new URLSearchParams({
|
||||||
|
repo: res!.agent.sub,
|
||||||
|
collection: 'app.bsky.actor.profile',
|
||||||
|
rkey: 'self',
|
||||||
|
}).toString(),
|
||||||
|
)
|
||||||
|
const json = await profileRes?.json()
|
||||||
|
setProfile(json.value)
|
||||||
|
})()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CenteredView>
|
||||||
|
<Text>{profile ? profile.displayName : 'Loading'}</Text>
|
||||||
|
</CenteredView>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {logger} from '#/logger'
|
|||||||
import {useSessionApi} from '#/state/session'
|
import {useSessionApi} from '#/state/session'
|
||||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||||
import {useRequestNotificationsPermission} from 'lib/notifications/notifications'
|
import {useRequestNotificationsPermission} from 'lib/notifications/notifications'
|
||||||
import {useGate} from 'lib/statsig/statsig'
|
// import {useGate} from 'lib/statsig/statsig'
|
||||||
import {useSetHasCheckedForStarterPack} from 'state/preferences/used-starter-packs'
|
import {useSetHasCheckedForStarterPack} from 'state/preferences/used-starter-packs'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
@@ -43,13 +43,13 @@ import {FormContainer} from './FormContainer'
|
|||||||
|
|
||||||
type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
|
type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
|
||||||
|
|
||||||
const client = new BrowserOAuthClient({
|
export const client = new BrowserOAuthClient({
|
||||||
plcDirectoryUrl: 'https://plc.directory',
|
plcDirectoryUrl: 'https://plc.directory',
|
||||||
handleResolver: 'https://bsky.social',
|
handleResolver: 'https://bsky.social',
|
||||||
clientMetadata: {
|
clientMetadata: {
|
||||||
client_id: 'http://localhost:19006/',
|
client_id: 'https://.ngrok-free.app/.well-known/client-metadata.json',
|
||||||
redirect_uris: ['http://localhost:19006/auth/callback'],
|
client_name: 'Bluesky',
|
||||||
response_types: ['code'],
|
redirect_uris: ['https://.ngrok-free.app/auth/callback'],
|
||||||
token_endpoint_auth_method: 'none',
|
token_endpoint_auth_method: 'none',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -186,8 +186,8 @@ export const LoginForm = ({
|
|||||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||||
const setHasCheckedForStarterPack = useSetHasCheckedForStarterPack()
|
const setHasCheckedForStarterPack = useSetHasCheckedForStarterPack()
|
||||||
|
|
||||||
const gate = useGate()
|
// const gate = useGate()
|
||||||
const oauthEnabled = __DEV__ || gate('use_oauth')
|
const oauthEnabled = true
|
||||||
const oauth = useOAuth(client)
|
const oauth = useOAuth(client)
|
||||||
const [handle, setHandle] = React.useState('')
|
const [handle, setHandle] = React.useState('')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user