Configure proxy
This commit is contained in:
@@ -6,5 +6,3 @@ export const LOG_LEVEL = (process.env.EXPO_PUBLIC_LOG_LEVEL || 'info') as
|
||||
| 'error'
|
||||
|
||||
export const APPVIEW_PROXY = process.env.APPVIEW_PROXY || ''
|
||||
|
||||
console.log({APPVIEW_PROXY})
|
||||
|
||||
@@ -13,6 +13,7 @@ import {tryFetchGates} from '#/lib/statsig/statsig'
|
||||
import {getAge} from '#/lib/strings/time'
|
||||
import {logger} from '#/logger'
|
||||
import {snoozeEmailConfirmationPrompt} from '#/state/shell/reminders'
|
||||
import {APPVIEW_PROXY} from '#/env'
|
||||
import {emitNetworkConfirmed, emitNetworkLost} from '../events'
|
||||
import {addSessionErrorLog} from './logging'
|
||||
import {
|
||||
@@ -24,6 +25,7 @@ import {isSessionExpired, isSignupQueued} from './util'
|
||||
|
||||
export function createPublicAgent() {
|
||||
configureModerationForGuest() // Side effect but only relevant for tests
|
||||
// TODO logged out view
|
||||
return new BskyAppAgent({service: PUBLIC_BSKY_SERVICE})
|
||||
}
|
||||
|
||||
@@ -36,6 +38,7 @@ export async function createAgentAndResume(
|
||||
) => void,
|
||||
) {
|
||||
const agent = new BskyAppAgent({service: storedAccount.service})
|
||||
agent.configureProxy(`did:web:${APPVIEW_PROXY}#bsky_appview`)
|
||||
if (storedAccount.pdsUrl) {
|
||||
agent.sessionManager.pdsUrl = new URL(storedAccount.pdsUrl)
|
||||
}
|
||||
@@ -83,6 +86,7 @@ export async function createAgentAndLogin(
|
||||
) => void,
|
||||
) {
|
||||
const agent = new BskyAppAgent({service})
|
||||
agent.configureProxy(`did:web:${APPVIEW_PROXY}#bsky_appview`)
|
||||
await agent.login({identifier, password, authFactorToken})
|
||||
|
||||
const account = agentToSessionAccountOrThrow(agent)
|
||||
@@ -118,6 +122,7 @@ export async function createAgentAndCreateAccount(
|
||||
) => void,
|
||||
) {
|
||||
const agent = new BskyAppAgent({service})
|
||||
agent.configureProxy(`did:web:${APPVIEW_PROXY}#bsky_appview`)
|
||||
await agent.createAccount({
|
||||
email,
|
||||
password,
|
||||
|
||||
Reference in New Issue
Block a user