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 5b769d348d..6d93b0cfdb 100644 --- a/modules/expo-bluesky-oauth-client/src/react-native-key.ts +++ b/modules/expo-bluesky-oauth-client/src/react-native-key.ts @@ -19,11 +19,7 @@ export class ReactNativeKey extends Key { // Note: OauthClientReactNative.generatePrivateJwk should throw if it // doesn't support the algorithm. const res = await OauthClientReactNative.generateJwk(algo) - const jwk = jwkValidator.parse({ - ...res.privateKey, - key_ops: ['sign', 'verify'], - kid, - }) + const jwk = res.privateKey const use = jwk.use || 'sig' return new ReactNativeKey(jwkValidator.parse({...jwk, use, kid})) } catch { @@ -44,12 +40,15 @@ export class ReactNativeKey extends Key { >(token: Jwt, options?: VerifyOptions): Promise> { const result = await OauthClientReactNative.verifyJwt(token, this.jwk) + // TODO see if we can make these `undefined` or maybe update zod to allow `nullable()` let payloadParsed = JSON.parse(result.payload) payloadParsed = Object.fromEntries( Object.entries(payloadParsed as object).filter(([_, v]) => v !== null), ) - const payload = jwtPayloadSchema.parse(payloadParsed) + + // 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 if (options?.audience != null) { diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index f50d9a8fca..bb4e9e1aa8 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -69,6 +69,8 @@ function HomeScreenReady({ ) const verified = await key.verifyJwt(jwt) + + console.log(verified) })() }, [])