atproto-proxy behavior seems ambiguous right now, it's not really clear whether PDS implementors should interpret atproto-proxy before or after PDS' own route handlers. This PR ensures that com.atproto.* calls go through without a proxy set (with some exception)
+2
-1
src/ageAssurance/data.tsx
+2
-1
src/ageAssurance/data.tsx
···
20
20
snoozeBirthdateUpdateAllowedForDid,
21
21
} from '#/state/birthdate'
22
22
import {useAgent, useSession} from '#/state/session'
23
+
import {pdsAgent} from '#/state/session/agent'
23
24
import * as debug from '#/ageAssurance/debug'
24
25
import {logger} from '#/ageAssurance/logger'
25
26
import {
···
323
324
agent: AtpAgent
324
325
}): Promise<OtherRequiredData> {
325
326
if (debug.enabled) return debug.resolve(debug.otherRequiredData)
326
-
const [prefs] = await Promise.all([agent.getPreferences()])
327
+
const [prefs] = await Promise.all([pdsAgent(agent).getPreferences()])
327
328
const data: OtherRequiredData = {
328
329
birthdate: prefs.birthDate ? prefs.birthDate.toISOString() : undefined,
329
330
}
+4
-3
src/components/live/queries.ts
+4
-3
src/components/live/queries.ts
···
16
16
import {updateProfileShadow} from '#/state/cache/profile-shadow'
17
17
import {useLiveNowConfig} from '#/state/service-config'
18
18
import {useAgent, useSession} from '#/state/session'
19
+
import {pdsAgent} from '#/state/session/agent'
19
20
import * as Toast from '#/view/com/util/Toast'
20
21
import {useDialogContext} from '#/components/Dialog'
21
22
···
108
109
const repo = currentAccount.did
109
110
const collection = 'app.bsky.actor.status'
110
111
111
-
const existing = await agent.com.atproto.repo
112
-
.getRecord({repo, collection, rkey: 'self'})
112
+
const existing = await pdsAgent(agent)
113
+
.com.atproto.repo.getRecord({repo, collection, rkey: 'self'})
113
114
.catch(_e => undefined)
114
115
115
-
await agent.com.atproto.repo.putRecord({
116
+
await pdsAgent(agent).com.atproto.repo.putRecord({
116
117
repo,
117
118
collection,
118
119
rkey: 'self',
+2
-1
src/lib/api/index.ts
+2
-1
src/lib/api/index.ts
···
34
34
createThreadgateRecord,
35
35
threadgateAllowUISettingToAllowRecordValue,
36
36
} from '#/state/queries/threadgate'
37
+
import {pdsAgent} from '#/state/session/agent'
37
38
import {
38
39
type EmbedDraft,
39
40
type PostDraft,
···
172
173
}
173
174
174
175
try {
175
-
await agent.com.atproto.repo.applyWrites({
176
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
176
177
repo: agent.assertDid,
177
178
writes: writes,
178
179
validate: true,
+2
-1
src/lib/generate-starterpack.ts
+2
-1
src/lib/generate-starterpack.ts
···
15
15
import {sanitizeHandle} from '#/lib/strings/handles'
16
16
import {enforceLen} from '#/lib/strings/helpers'
17
17
import {useAgent} from '#/state/session'
18
+
import {pdsAgent} from '#/state/session/agent'
18
19
import type * as bsky from '#/types/bsky'
19
20
20
21
export const createStarterPackList = async ({
···
44
45
},
45
46
)
46
47
if (!list) throw new Error('List creation failed')
47
-
await agent.com.atproto.repo.applyWrites({
48
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
48
49
repo: agent.session!.did,
49
50
writes: profiles.map(p => createListItem({did: p.did, listUri: list.uri})),
50
51
})
+2
-1
src/screens/Onboarding/util.ts
+2
-1
src/screens/Onboarding/util.ts
···
9
9
import chunk from 'lodash.chunk'
10
10
11
11
import {until} from '#/lib/async/until'
12
+
import {pdsAgent} from '#/state/session/agent'
12
13
13
14
export async function bulkWriteFollows(agent: BskyAgent, dids: string[]) {
14
15
const session = agent.session
···
35
36
36
37
const chunks = chunk(followWrites, 50)
37
38
for (const chunk of chunks) {
38
-
await agent.com.atproto.repo.applyWrites({
39
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
39
40
repo: session.did,
40
41
writes: chunk,
41
42
})
+3
-2
src/state/queries/list.ts
+3
-2
src/state/queries/list.ts
···
17
17
import {type ImageMeta} from '#/state/gallery'
18
18
import {STALE} from '#/state/queries'
19
19
import {useAgent, useSession} from '#/state/session'
20
+
import {pdsAgent} from '#/state/session/agent'
20
21
import {invalidate as invalidateMyLists} from './my-lists'
21
22
import {RQKEY as PROFILE_LISTS_RQKEY} from './profile-lists'
22
23
···
152
153
record.avatar = undefined
153
154
}
154
155
const res = (
155
-
await agent.com.atproto.repo.putRecord({
156
+
await pdsAgent(agent).com.atproto.repo.putRecord({
156
157
repo: currentAccount.did,
157
158
collection: 'app.bsky.graph.list',
158
159
rkey,
···
231
232
232
233
// apply in chunks
233
234
for (const writesChunk of chunk(writes, 10)) {
234
-
await agent.com.atproto.repo.applyWrites({
235
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
235
236
repo: currentAccount.did,
236
237
writes: writesChunk,
237
238
})
+3
-2
src/state/queries/messages/actor-declaration.ts
+3
-2
src/state/queries/messages/actor-declaration.ts
···
3
3
4
4
import {logger} from '#/logger'
5
5
import {useAgent, useSession} from '#/state/session'
6
+
import {pdsAgent} from '#/state/session/agent'
6
7
import {RQKEY as PROFILE_RKEY} from '../profile'
7
8
8
9
export function useUpdateActorDeclaration({
···
19
20
return useMutation({
20
21
mutationFn: async (allowIncoming: 'all' | 'none' | 'following') => {
21
22
if (!currentAccount) throw new Error('Not signed in')
22
-
const result = await agent.com.atproto.repo.putRecord({
23
+
const result = await pdsAgent(agent).com.atproto.repo.putRecord({
23
24
repo: currentAccount.did,
24
25
collection: 'chat.bsky.actor.declaration',
25
26
rkey: 'self',
···
69
70
return useMutation({
70
71
mutationFn: async () => {
71
72
if (!currentAccount) throw new Error('Not signed in')
72
-
const result = await agent.api.com.atproto.repo.deleteRecord({
73
+
const result = await pdsAgent(agent).com.atproto.repo.deleteRecord({
73
74
repo: currentAccount.did,
74
75
collection: 'chat.bsky.actor.declaration',
75
76
rkey: 'self',
+2
-1
src/state/queries/postgate/index.ts
+2
-1
src/state/queries/postgate/index.ts
···
21
21
POSTGATE_COLLECTION,
22
22
} from '#/state/queries/postgate/util'
23
23
import {useAgent} from '#/state/session'
24
+
import {pdsAgent} from '#/state/session/agent'
24
25
import * as bsky from '#/types/bsky'
25
26
26
27
export async function getPostgateRecord({
···
96
97
const postUrip = new AtUri(postUri)
97
98
98
99
await networkRetry(2, () =>
99
-
agent.api.com.atproto.repo.putRecord({
100
+
pdsAgent(agent).com.atproto.repo.putRecord({
100
101
repo: agent.session!.did,
101
102
collection: POSTGATE_COLLECTION,
102
103
rkey: postUrip.rkey,
+3
-2
src/state/queries/preferences/index.ts
+3
-2
src/state/queries/preferences/index.ts
···
21
21
type UsePreferencesQueryResponse,
22
22
} from '#/state/queries/preferences/types'
23
23
import {useAgent} from '#/state/session'
24
+
import {pdsAgent} from '#/state/session/agent'
24
25
import {saveLabelers} from '#/state/session/agent-config'
25
26
import {useAgeAssurance} from '#/ageAssurance'
26
27
import {makeAgeRestrictedModerationPrefs} from '#/ageAssurance/util'
···
45
46
if (!agent.did) {
46
47
return DEFAULT_LOGGED_OUT_PREFERENCES
47
48
} else {
48
-
const res = await agent.getPreferences()
49
+
const res = await pdsAgent(agent).getPreferences()
49
50
50
51
// save to local storage to ensure there are labels on initial requests
51
52
saveLabelers(
···
100
101
101
102
return useMutation({
102
103
mutationFn: async () => {
103
-
await agent.app.bsky.actor.putPreferences({preferences: []})
104
+
await pdsAgent(agent).app.bsky.actor.putPreferences({preferences: []})
104
105
// triggers a refetch
105
106
await queryClient.invalidateQueries({
106
107
queryKey: preferencesQueryKey,
+4
-3
src/state/queries/starter-packs.ts
+4
-3
src/state/queries/starter-packs.ts
···
27
27
import {STALE} from '#/state/queries/index'
28
28
import {invalidateListMembersQuery} from '#/state/queries/list-members'
29
29
import {useAgent} from '#/state/session'
30
+
import {pdsAgent} from '#/state/session/agent'
30
31
import * as bsky from '#/types/bsky'
31
32
32
33
const RQKEY_ROOT = 'starter-pack'
···
203
204
if (removedItems.length !== 0) {
204
205
const chunks = chunk(removedItems, 50)
205
206
for (const chunk of chunks) {
206
-
await agent.com.atproto.repo.applyWrites({
207
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
207
208
repo: agent.session!.did,
208
209
writes: chunk.map(i => ({
209
210
$type: 'com.atproto.repo.applyWrites#delete',
···
220
221
if (addedProfiles.length > 0) {
221
222
const chunks = chunk(addedProfiles, 50)
222
223
for (const chunk of chunks) {
223
-
await agent.com.atproto.repo.applyWrites({
224
+
await pdsAgent(agent).com.atproto.repo.applyWrites({
224
225
repo: agent.session!.did,
225
226
writes: chunk.map(p => ({
226
227
$type: 'com.atproto.repo.applyWrites#create',
···
237
238
}
238
239
239
240
const rkey = parseStarterPackUri(currentStarterPack.uri)!.rkey
240
-
await agent.com.atproto.repo.putRecord({
241
+
await pdsAgent(agent).com.atproto.repo.putRecord({
241
242
repo: agent.session!.did,
242
243
collection: 'app.bsky.graph.starterpack',
243
244
rkey,
+2
-1
src/state/queries/threadgate/index.ts
+2
-1
src/state/queries/threadgate/index.ts
···
18
18
} from '#/state/queries/threadgate/util'
19
19
import {useUpdatePostThreadThreadgateQueryCache} from '#/state/queries/usePostThread'
20
20
import {useAgent} from '#/state/session'
21
+
import {pdsAgent} from '#/state/session/agent'
21
22
import {useThreadgateHiddenReplyUrisAPI} from '#/state/threadgate-hidden-replies'
22
23
import * as bsky from '#/types/bsky'
23
24
···
162
163
})
163
164
164
165
await networkRetry(2, () =>
165
-
agent.api.com.atproto.repo.putRecord({
166
+
pdsAgent(agent).com.atproto.repo.putRecord({
166
167
repo: agent.session!.did,
167
168
collection: 'app.bsky.feed.threadgate',
168
169
rkey: postUrip.rkey,
+12
-1
src/state/session/agent.ts
+12
-1
src/state/session/agent.ts
···
234
234
}),
235
235
getAge(birthDate) < 18 &&
236
236
networkRetry(3, () => {
237
-
return agent.com.atproto.repo.putRecord({
237
+
return pdsAgent(agent).com.atproto.repo.putRecord({
238
238
repo: account.did,
239
239
collection: 'chat.bsky.actor.declaration',
240
240
rkey: 'self',
···
439
439
}
440
440
}
441
441
442
+
/**
443
+
* Returns an agent configured to make requests directly to the user's PDS
444
+
* without the appview proxy header. Use this for com.atproto.* methods and
445
+
* other PDS-specific operations like preferences.
446
+
*/
447
+
export function pdsAgent<T extends BaseAgent>(agent: T): T {
448
+
const clone = agent.clone() as T
449
+
clone.configureProxy(null)
450
+
return clone
451
+
}
452
+
442
453
export type {BskyAppAgent}
+2
-1
src/state/session/index.tsx
+2
-1
src/state/session/index.tsx
···
12
12
createAgentAndCreateAccount,
13
13
createAgentAndLogin,
14
14
createAgentAndResume,
15
+
pdsAgent,
15
16
sessionAccountToSession,
16
17
} from './agent'
17
18
import {type Action, getInitialState, reducer, type State} from './reducer'
···
248
249
>(async () => {
249
250
const agent = state.currentAgentState.agent as BskyAppAgent
250
251
const signal = cancelPendingTask()
251
-
const {data} = await agent.com.atproto.server.getSession()
252
+
const {data} = await pdsAgent(agent).com.atproto.server.getSession()
252
253
if (signal.aborted) return
253
254
store.dispatch({
254
255
type: 'partial-refresh-session',
+2
-1
src/ageAssurance/useBeginAgeAssurance.ts
+2
-1
src/ageAssurance/useBeginAgeAssurance.ts
···
10
10
} from '#/lib/constants'
11
11
import {isNetworkError} from '#/lib/hooks/useCleanError'
12
12
import {useAgent} from '#/state/session'
13
+
import {pdsAgent} from '#/state/session/agent'
13
14
import {usePatchAgeAssuranceServerState} from '#/ageAssurance'
14
15
import {logger} from '#/ageAssurance/logger'
15
16
import {BLUESKY_PROXY_DID} from '#/env'
···
38
39
39
40
const {
40
41
data: {token},
41
-
} = await agent.com.atproto.server.getServiceAuth({
42
+
} = await pdsAgent(agent).com.atproto.server.getServiceAuth({
42
43
aud: BLUESKY_PROXY_DID,
43
44
lxm: `app.bsky.ageassurance.begin`,
44
45
})
+2
-1
src/components/dialogs/EmailDialog/data/useConfirmEmail.ts
+2
-1
src/components/dialogs/EmailDialog/data/useConfirmEmail.ts
···
1
1
import {useMutation} from '@tanstack/react-query'
2
2
3
3
import {useAgent, useSession} from '#/state/session'
4
+
import {pdsAgent} from '#/state/session/agent'
4
5
5
6
export function useConfirmEmail({
6
7
onSuccess,
···
15
16
throw new Error('No email found for the current account')
16
17
}
17
18
18
-
await agent.com.atproto.server.confirmEmail({
19
+
await pdsAgent(agent).com.atproto.server.confirmEmail({
19
20
email: currentAccount.email.trim(),
20
21
token: token.trim(),
21
22
})
+2
-1
src/components/dialogs/EmailDialog/data/useManageEmail2FA.ts
+2
-1
src/components/dialogs/EmailDialog/data/useManageEmail2FA.ts
···
1
1
import {useMutation} from '@tanstack/react-query'
2
2
3
3
import {useAgent, useSession} from '#/state/session'
4
+
import {pdsAgent} from '#/state/session/agent'
4
5
5
6
export function useManageEmail2FA() {
6
7
const agent = useAgent()
···
17
18
throw new Error('No email found for the current account')
18
19
}
19
20
20
-
await agent.com.atproto.server.updateEmail({
21
+
await pdsAgent(agent).com.atproto.server.updateEmail({
21
22
email: currentAccount.email,
22
23
emailAuthFactor: enabled,
23
24
token,
+3
-1
src/components/dialogs/EmailDialog/data/useRequestEmailUpdate.ts
+3
-1
src/components/dialogs/EmailDialog/data/useRequestEmailUpdate.ts
···
1
1
import {useMutation} from '@tanstack/react-query'
2
2
3
3
import {useAgent} from '#/state/session'
4
+
import {pdsAgent} from '#/state/session/agent'
4
5
5
6
export function useRequestEmailUpdate() {
6
7
const agent = useAgent()
7
8
8
9
return useMutation({
9
10
mutationFn: async () => {
10
-
return (await agent.com.atproto.server.requestEmailUpdate()).data
11
+
return (await pdsAgent(agent).com.atproto.server.requestEmailUpdate())
12
+
.data
11
13
},
12
14
})
13
15
}
+2
-1
src/components/dialogs/EmailDialog/data/useRequestEmailVerification.ts
+2
-1
src/components/dialogs/EmailDialog/data/useRequestEmailVerification.ts
···
1
1
import {useMutation} from '@tanstack/react-query'
2
2
3
3
import {useAgent} from '#/state/session'
4
+
import {pdsAgent} from '#/state/session/agent'
4
5
5
6
export function useRequestEmailVerification() {
6
7
const agent = useAgent()
7
8
8
9
return useMutation({
9
10
mutationFn: async () => {
10
-
await agent.com.atproto.server.requestEmailConfirmation()
11
+
await pdsAgent(agent).com.atproto.server.requestEmailConfirmation()
11
12
},
12
13
})
13
14
}
+5
-1
src/components/dialogs/EmailDialog/data/useUpdateEmail.ts
+5
-1
src/components/dialogs/EmailDialog/data/useUpdateEmail.ts
···
1
1
import {useMutation} from '@tanstack/react-query'
2
2
3
3
import {useAgent} from '#/state/session'
4
+
import {pdsAgent} from '#/state/session/agent'
4
5
import {useRequestEmailUpdate} from '#/components/dialogs/EmailDialog/data/useRequestEmailUpdate'
5
6
6
7
async function updateEmailAndRefreshSession(
···
8
9
email: string,
9
10
token?: string,
10
11
) {
11
-
await agent.com.atproto.server.updateEmail({email: email.trim(), token})
12
+
await pdsAgent(agent).com.atproto.server.updateEmail({
13
+
email: email.trim(),
14
+
token,
15
+
})
12
16
await agent.resumeSession(agent.session!)
13
17
}
14
18
+2
-1
src/components/intents/VerifyEmailIntentDialog.tsx
+2
-1
src/components/intents/VerifyEmailIntentDialog.tsx
···
5
5
6
6
import {isNative} from '#/platform/detection'
7
7
import {useAgent, useSession} from '#/state/session'
8
+
import {pdsAgent} from '#/state/session/agent'
8
9
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
9
10
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
10
11
import * as Dialog from '#/components/Dialog'
···
51
52
52
53
const onPressResendEmail = async () => {
53
54
setSending(true)
54
-
await agent.com.atproto.server.requestEmailConfirmation()
55
+
await pdsAgent(agent).com.atproto.server.requestEmailConfirmation()
55
56
setSending(false)
56
57
setStatus('resent')
57
58
}
+2
-1
src/screens/Deactivated.tsx
+2
-1
src/screens/Deactivated.tsx
···
14
14
useSession,
15
15
useSessionApi,
16
16
} from '#/state/session'
17
+
import {pdsAgent} from '#/state/session/agent'
17
18
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
18
19
import {Logo} from '#/view/icons/Logo'
19
20
import {atoms as a, useTheme} from '#/alf'
···
69
70
const handleActivate = React.useCallback(async () => {
70
71
try {
71
72
setPending(true)
72
-
await agent.com.atproto.server.activateAccount()
73
+
await pdsAgent(agent).com.atproto.server.activateAccount()
73
74
await queryClient.resetQueries()
74
75
await agent.resumeSession(agent.session!)
75
76
} catch (e: any) {
+3
-2
src/screens/Settings/components/ChangePasswordDialog.tsx
+3
-2
src/screens/Settings/components/ChangePasswordDialog.tsx
···
9
9
import {logger} from '#/logger'
10
10
import {isNative} from '#/platform/detection'
11
11
import {useAgent, useSession} from '#/state/session'
12
+
import {pdsAgent} from '#/state/session/agent'
12
13
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
13
14
import {android, atoms as a, web} from '#/alf'
14
15
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
···
84
85
setError('')
85
86
setIsProcessing(true)
86
87
try {
87
-
await agent.com.atproto.server.requestPasswordReset({
88
+
await pdsAgent(agent).com.atproto.server.requestPasswordReset({
88
89
email: currentAccount.email,
89
90
})
90
91
setStage(Stages.ChangePassword)
···
128
129
setError('')
129
130
setIsProcessing(true)
130
131
try {
131
-
await agent.com.atproto.server.resetPassword({
132
+
await pdsAgent(agent).com.atproto.server.resetPassword({
132
133
token: formattedCode,
133
134
password: newPassword,
134
135
})
+2
-1
src/screens/Settings/components/DeactivateAccountDialog.tsx
+2
-1
src/screens/Settings/components/DeactivateAccountDialog.tsx
···
5
5
6
6
import {logger} from '#/logger'
7
7
import {useAgent, useSessionApi} from '#/state/session'
8
+
import {pdsAgent} from '#/state/session/agent'
8
9
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
9
10
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
10
11
import {type DialogOuterProps} from '#/components/Dialog'
···
42
43
const handleDeactivate = React.useCallback(async () => {
43
44
try {
44
45
setPending(true)
45
-
await agent.com.atproto.server.deactivateAccount({})
46
+
await pdsAgent(agent).com.atproto.server.deactivateAccount({})
46
47
control.close(() => {
47
48
logoutCurrentAccount('Deactivated')
48
49
})
+3
-2
src/screens/Settings/components/DisableEmail2FADialog.tsx
+3
-2
src/screens/Settings/components/DisableEmail2FADialog.tsx
···
6
6
import {cleanError} from '#/lib/strings/errors'
7
7
import {isNative} from '#/platform/detection'
8
8
import {useAgent, useSession} from '#/state/session'
9
+
import {pdsAgent} from '#/state/session/agent'
9
10
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
10
11
import * as Toast from '#/view/com/util/Toast'
11
12
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
···
41
42
setError('')
42
43
setIsProcessing(true)
43
44
try {
44
-
await agent.com.atproto.server.requestEmailUpdate()
45
+
await pdsAgent(agent).com.atproto.server.requestEmailUpdate()
45
46
setStage(Stages.ConfirmCode)
46
47
} catch (e) {
47
48
setError(cleanError(String(e)))
···
55
56
setIsProcessing(true)
56
57
try {
57
58
if (currentAccount?.email) {
58
-
await agent.com.atproto.server.updateEmail({
59
+
await pdsAgent(agent).com.atproto.server.updateEmail({
59
60
email: currentAccount!.email,
60
61
token: confirmationCode.trim(),
61
62
emailAuthFactor: false,
+2
-1
src/screens/Settings/components/ExportCarDialog.tsx
+2
-1
src/screens/Settings/components/ExportCarDialog.tsx
···
6
6
import {saveBytesToDisk} from '#/lib/media/manip'
7
7
import {logger} from '#/logger'
8
8
import {useAgent} from '#/state/session'
9
+
import {pdsAgent} from '#/state/session/agent'
9
10
import {atoms as a, useTheme, web} from '#/alf'
10
11
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
11
12
import * as Dialog from '#/components/Dialog'
···
32
33
try {
33
34
setLoading(true)
34
35
const did = agent.session.did
35
-
const downloadRes = await agent.com.atproto.sync.getRepo({did})
36
+
const downloadRes = await pdsAgent(agent).com.atproto.sync.getRepo({did})
36
37
const saveRes = await saveBytesToDisk(
37
38
'repo.car',
38
39
downloadRes.data,
+2
-1
src/screens/SignupQueued.tsx
+2
-1
src/screens/SignupQueued.tsx
···
8
8
import {logger} from '#/logger'
9
9
import {isIOS, isWeb} from '#/platform/detection'
10
10
import {isSignupQueued, useAgent, useSessionApi} from '#/state/session'
11
+
import {pdsAgent} from '#/state/session/agent'
11
12
import {useOnboardingDispatch} from '#/state/shell'
12
13
import {Logo} from '#/view/icons/Logo'
13
14
import {atoms as a, native, useBreakpoints, useTheme, web} from '#/alf'
···
37
38
const checkStatus = React.useCallback(async () => {
38
39
setProcessing(true)
39
40
try {
40
-
const res = await agent.com.atproto.temp.checkSignupQueue()
41
+
const res = await pdsAgent(agent).com.atproto.temp.checkSignupQueue()
41
42
if (res.data.activated) {
42
43
// ready to go, exchange the access token for a usable one and kick off onboarding
43
44
await agent.sessionManager.refreshSession()
+4
-3
src/state/queries/app-passwords.ts
+4
-3
src/state/queries/app-passwords.ts
···
3
3
4
4
import {STALE} from '#/state/queries'
5
5
import {useAgent} from '../session'
6
+
import {pdsAgent} from '../session/agent'
6
7
7
8
const RQKEY_ROOT = 'app-passwords'
8
9
export const RQKEY = () => [RQKEY_ROOT]
···
13
14
staleTime: STALE.MINUTES.FIVE,
14
15
queryKey: RQKEY(),
15
16
queryFn: async () => {
16
-
const res = await agent.com.atproto.server.listAppPasswords({})
17
+
const res = await pdsAgent(agent).com.atproto.server.listAppPasswords({})
17
18
return res.data.passwords
18
19
},
19
20
})
···
29
30
>({
30
31
mutationFn: async ({name, privileged}) => {
31
32
return (
32
-
await agent.com.atproto.server.createAppPassword({
33
+
await pdsAgent(agent).com.atproto.server.createAppPassword({
33
34
name,
34
35
privileged,
35
36
})
···
48
49
const agent = useAgent()
49
50
return useMutation<void, Error, {name: string}>({
50
51
mutationFn: async ({name}) => {
51
-
await agent.com.atproto.server.revokeAppPassword({
52
+
await pdsAgent(agent).com.atproto.server.revokeAppPassword({
52
53
name,
53
54
})
54
55
},
+3
-2
src/view/com/modals/DeleteAccount.tsx
+3
-2
src/view/com/modals/DeleteAccount.tsx
···
19
19
import {isAndroid, isWeb} from '#/platform/detection'
20
20
import {useModalControls} from '#/state/modals'
21
21
import {useAgent, useSession, useSessionApi} from '#/state/session'
22
+
import {pdsAgent} from '#/state/session/agent'
22
23
import {atoms as a, useTheme as useNewTheme} from '#/alf'
23
24
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
24
25
import {Text as NewText} from '#/components/Typography'
···
49
50
setError('')
50
51
setIsProcessing(true)
51
52
try {
52
-
await agent.com.atproto.server.requestAccountDelete()
53
+
await pdsAgent(agent).com.atproto.server.requestAccountDelete()
53
54
setIsEmailSent(true)
54
55
} catch (e: any) {
55
56
setError(cleanError(e))
···
76
77
if (!success) {
77
78
throw new Error('Failed to inform chat service of account deletion')
78
79
}
79
-
await agent.com.atproto.server.deleteAccount({
80
+
await pdsAgent(agent).com.atproto.server.deleteAccount({
80
81
did: currentAccount.did,
81
82
password,
82
83
token,