diff --git a/modules/expo-bluesky-oauth-client/src/react-native-key.ts b/modules/expo-bluesky-oauth-client/src/react-native-key.ts index 6d93b0cfdb..6f76b5ca33 100644 --- a/modules/expo-bluesky-oauth-client/src/react-native-key.ts +++ b/modules/expo-bluesky-oauth-client/src/react-native-key.ts @@ -49,7 +49,9 @@ export class ReactNativeKey extends Key { // We don't need to validate this, because the native types ensure it is correct. But this is a TODO // for the same reason above - const protectedHeader = result.protectedHeader + const protectedHeader = Object.fromEntries( + Object.entries(result.protectedHeader).filter(([_, v]) => v !== null), + ) if (options?.audience != null) { const audience = Array.isArray(options.audience) diff --git a/modules/expo-bluesky-oauth-client/src/react-native-oauth-database.native.ts b/modules/expo-bluesky-oauth-client/src/react-native-oauth-database.native.ts index 96a7ae74d7..c85275f343 100644 --- a/modules/expo-bluesky-oauth-client/src/react-native-oauth-database.native.ts +++ b/modules/expo-bluesky-oauth-client/src/react-native-oauth-database.native.ts @@ -14,13 +14,10 @@ type Item = { type EncodedKey = { keyId: string - keyPair: CryptoKeyPair + keyPair: CryptoKey } function encodeKey(key: Key): EncodedKey { - if (!(key instanceof WebcryptoKey) || !key.kid) { - throw new Error('Invalid key object') - } return { keyId: key.kid, keyPair: key.cryptoKeyPair, @@ -42,7 +39,6 @@ export type Schema = { }> session: Item<{ dpopKey: EncodedKey - tokenSet: TokenSet }> diff --git a/src/screens/Login/LoginForm.tsx b/src/screens/Login/LoginForm.tsx index 0c541c5a90..6f20354be0 100644 --- a/src/screens/Login/LoginForm.tsx +++ b/src/screens/Login/LoginForm.tsx @@ -1,12 +1,10 @@ import React from 'react' import {Keyboard, View} from 'react-native' -import * as Browser from 'expo-web-browser' import {ComAtprotoServerDescribeServer} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useAnalytics} from '#/lib/analytics/analytics' -import {isAndroid} from 'platform/detection' import {useLogin} from '#/screens/Login/hooks/useLogin' import {atoms as a} from '#/alf' import {Button, ButtonText} from '#/components/Button' @@ -34,14 +32,7 @@ export const LoginForm = ({ }) => { const {track} = useAnalytics() const {_} = useLingui() - const {openAuthSession} = useLogin(serviceUrl) - - // This improves speed at which the browser presents itself on Android - React.useEffect(() => { - if (isAndroid) { - Browser.warmUpAsync() - } - }, []) + const {openAuthSession} = useLogin() const onPressSelectService = React.useCallback(() => { Keyboard.dismiss()