Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README Usage #270

Merged
merged 2 commits into from
Sep 13, 2019
Merged

docs: update README Usage #270

merged 2 commits into from
Sep 13, 2019

Conversation

grzuy
Copy link
Contributor

@grzuy grzuy commented Sep 13, 2019

Closes #244

@grzuy grzuy marked this pull request as ready for review September 13, 2019 19:53
README.md Outdated
if !user.webauthn_id
user.update!(webauthn_id: WebAuthn.generate_user_id)
end

create_options = WebAuthn::Credential.create_options(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are meant to be the "options for the create function"...

Wonder if create_options might make you feel its actually "creating options", instead of returning the "options for the create".

Maybe WebAuthn::Credential.options_for_create is better and less prone to confusion.
Even WebAuthn::Credential.registration_options maybe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree that create_options and get_options might be a bit ambiguous—especially get_options.

Given the consistency with the client API, I'd be inclined to go for options_for_create and options_for_get.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah...
Thanks for the feedback!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

README.md Outdated

```ruby
get_options = WebAuthn::Credential.get_options(allow: credential_id)
get_options = WebAuthn::Credential.get_options(allow: user.credentials.map { |c| c.webauthn_id })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here about .get_options.

Would .options_for_get or authentication_options be less confusing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@grzuy grzuy merged commit 5b1150a into master Sep 13, 2019
@grzuy grzuy deleted the readme branch September 13, 2019 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make WebAuthn::Credential interface publicly documented
2 participants