few small changes
This commit is contained in:
@@ -12,9 +12,9 @@ import IsomorphicOAuthServerMetadataResolver from '@atproto/oauth-server-metadat
|
||||
|
||||
import {CryptoSubtle} from './crypto-subtle'
|
||||
import {
|
||||
BrowserOAuthDatabase,
|
||||
DatabaseStore,
|
||||
PopupStateData,
|
||||
RNOAuthDatabase,
|
||||
} from './rn-oauth-database'
|
||||
|
||||
export type BrowserOauthClientFactoryOptions = {
|
||||
@@ -39,7 +39,7 @@ export class RNOAuthClientFactory extends OAuthClientFactory {
|
||||
crypto = globalThis.crypto,
|
||||
fetch = globalThis.fetch,
|
||||
}: BrowserOauthClientFactoryOptions) {
|
||||
const database = new BrowserOAuthDatabase()
|
||||
const database = new RNOAuthDatabase()
|
||||
|
||||
super({
|
||||
clientMetadata,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react'
|
||||
import * as Browser from 'expo-web-browser'
|
||||
import {BrowserOAuthClientFactory} from '@atproto/oauth-client-react-native'
|
||||
|
||||
import {
|
||||
buildOAuthUrl,
|
||||
@@ -12,11 +11,12 @@ import {
|
||||
OAUTH_RESPONSE_TYPES,
|
||||
OAUTH_SCOPE,
|
||||
} from 'lib/oauth'
|
||||
import {RNOAuthClientFactory} from '../../../../modules/expo-bluesky-oauth-client'
|
||||
|
||||
// Service URL here is just a placeholder, this isn't how it will actually work
|
||||
export function useLogin(serviceUrl: string | undefined) {
|
||||
const openAuthSession = React.useCallback(async () => {
|
||||
const oauthFactory = new BrowserOAuthClientFactory({
|
||||
const oauthFactory = new RNOAuthClientFactory({
|
||||
clientMetadata: {
|
||||
client_id: OAUTH_CLIENT_ID,
|
||||
redirect_uris: [OAUTH_REDIRECT_URI],
|
||||
@@ -28,7 +28,7 @@ export function useLogin(serviceUrl: string | undefined) {
|
||||
},
|
||||
})
|
||||
|
||||
await oauthFactory.signIn('afepwasfojefpaowejfpwef')
|
||||
await oauthFactory.signIn('alice.test')
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user