Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Differences in the Return Values of the RequestNewCredential Method in v4.0.0 #602

Answered by abergs
vt-haizawa asked this question in Q&A
Discussion options

I'm trying to migrate to v4.0.0.
My application had been checking that the status field in the makeCredentialOptions response JSON was "ok", which caused it to break.

Upon checking, unlike v3.0.1, CredentialCreateOptions no longer inherits from Fido2ResponseBase, so it appears the status field and errorMessage field are no longer included in the JSON.

The demo application code is as follows, but how should we actually check it correctly?

if (makeCredentialOptions.status === "error") {
You must be logged in to vote

PR for context

As mentioned in the PR, the base class was removed because the library never utilised the fields.

If an API method of the library fails, it would throw and exception. You should catch it and "consume" it any way that is meaningful to your app.

In the demo we return a json value that has the status variable and an error message: https://github.com/passwordless-lib/fido2-net-lib/blob/main/Demo/Controller.cs#L83. In our demo app, I believe we only ever set status to "error".

Replies: 1 comment 1 reply

Comment options

PR for context

As mentioned in the PR, the base class was removed because the library never utilised the fields.

If an API method of the library fails, it would throw and exception. You should catch it and "consume" it any way that is meaningful to your app.

In the demo we return a json value that has the status variable and an error message: https://github.com/passwordless-lib/fido2-net-lib/blob/main/Demo/Controller.cs#L83. In our demo app, I believe we only ever set status to "error".

You must be logged in to vote
1 reply
Comment options

Thank you for your reply.
I had overlooked that code in Controller.cs.
This is a great help. I should be able to continue with the migrations.

Answer selected by abergs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /