Skip to content

Commit 8d056ed

Browse files
committed
expo-apple-auth libdef: Make identityToken, authorizationCode non-optional
The Apple docs are frustratingly vague, but it doesn't seem to be the case that "no credential" and "yes credential, but no `identityToken`/`authorizationCode`" are separate auth failure modes that we have to distinguish. As I theorize in an Expo issue, these fields being marked optional does correspond to the Swift version of an Apple doc [1], where they're also marked optional. We still don't know exactly why that Apple doc has them marked optional, but corresponding values in a different protocol, the one you use on other platforms (i.e., not the native iOS flow), *are* marked optional for a particular reason [2]. In particular, they might be missing if you said you didn't want them. But...here, there doesn't seem to be a way to say you don't want them. So, they must be there. Also, in the JavaScript layer of `expo-apple-authentication`, an error is thrown if `identityToken` or `authorizationCode` is missing. (See `signInAsync` in `build/AppleAuthentication.js`.) [1]: expo/expo#8446 (comment) [2]: expo/expo#8446 (comment)
1 parent 1c638f4 commit 8d056ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flow-typed/expo-apple-authentication_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ declare module 'expo-apple-authentication/build/AppleAuthentication.types' {
164164
/**
165165
* A JSON Web Token (JWT) that securely communicates information about the user to your app.
166166
*/
167-
identityToken: string | null,
167+
identityToken: string,
168168

169169
/**
170170
* A short-lived session token used by your app for proof of authorization when interacting with
171171
* the app's server counterpart. Unlike `user`, this is ephemeral and will change each session.
172172
*/
173-
authorizationCode: string | null,
173+
authorizationCode: string,
174174
...
175175
};
176176
/**

0 commit comments

Comments
 (0)