[SDK] Migrate the account surface to the pds and service clients (#11367)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,10 @@ import {useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
|
||||
import {createServiceClient} from '#/lib/lexClient'
|
||||
import {cleanError, isNetworkError} from '#/lib/strings/errors'
|
||||
import {checkAndFormatResetCode} from '#/lib/strings/password'
|
||||
import {logger} from '#/logger'
|
||||
import {Agent} from '#/state/session/agent'
|
||||
import {atoms as a, web} from '#/alf'
|
||||
import {Admonition} from '#/components/Admonition'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
@@ -16,6 +16,7 @@ import {Loader} from '#/components/Loader'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {com} from '#/lexicons'
|
||||
import {FormContainer} from './FormContainer'
|
||||
|
||||
export const SetNewPasswordForm = ({
|
||||
@@ -61,8 +62,12 @@ export const SetNewPasswordForm = ({
|
||||
setIsProcessing(true)
|
||||
|
||||
try {
|
||||
const agent = new Agent(null, {service: serviceUrl})
|
||||
await agent.com.atproto.server.resetPassword({
|
||||
/*
|
||||
* Pre-auth request against a user-chosen host, so it goes through a
|
||||
* one-off service client rather than a session-scoped one.
|
||||
*/
|
||||
const client = createServiceClient(serviceUrl)
|
||||
await client.call(com.atproto.server.resetPassword, {
|
||||
token: formattedCode,
|
||||
password,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user