Add the ability to set preferImmediatelyAvailableCredentials on passkey requests - #405
Conversation
| * remote options, and false otherwise | ||
| */ | ||
| public data class PasskeyCredentialOptions( | ||
| val preferImmediatelyAvailableCredentials: Boolean = false, |
There was a problem hiding this comment.
On iOS we name this boolean preferLocalCredentials, suggest we align both names since they cover the same functionality.
There was a problem hiding this comment.
I slightly disagree, and think that our iOS SDK is in the wrong here.
preferImmediatelyAvailableCredentials is the actual name of the parameter for both iOS and Android; if someone is reading the documentation for either provider, and trying to implement our SDKs, I think it's better to expose the naming they will be familiar with, instead of hiding it behind a Stytch-specific flag
It would obviously be a larger change, but I would prefer to change the name in iOS (deprecate/rename) than change it here.
But I'm not deadset one way or the other ¯\_(ツ)_/¯
There was a problem hiding this comment.
In agreement! I primarily care about alignment here so the devx on both is the same; I have no opinion on the actual name of the flag.
I'm totally comfortable changing iOS if you think this name is more correct (note that would be a breaking change so we'll have to just be button'd up on the changelog).
There was a problem hiding this comment.
@chris-stytch on iOS, we actually don't pass bools for options like on Android, but instead, explicit ASAuthorizationController.RequestOptions types, and the preferLocalCredentials flag toggles setting the type. Aside from "hiding" the implementation detail that a developer might search for, this is also a little brittle if new RequestOptions are added in the future.
So, what I did on iOS is mark the .default(preferLocalCredentials: Bool) enum case as deprecated with a note to switch to .options([]), where a developer can pass the explicit options they want.
Code Coverage
|
Linear Ticket: No ticket
Changes:
preferImmediatelyAvailableCredentialson passkey requestsNotes:
Checklist: