add webauthn login/register buttons#1
Open
emoncuso wants to merge 4 commits into
Open
Conversation
emoncuso
commented
Oct 19, 2022
| // figure out how to get a username | ||
| const username = yield prompt('Username:'); | ||
|
|
||
| yield fetch('http://127.0.0.1:8200/v1/auth/webauthn/register/begin', { |
Owner
Author
There was a problem hiding this comment.
This yield syntax just adds a slightly nicer UX element for people
emoncuso
commented
Oct 19, 2022
Comment on lines
+110
to
+121
| return fetch(`/register/finish/${username}`, { | ||
| method: 'POST', | ||
| body: JSON.stringify({ | ||
| id: credential.id, | ||
| rawId: bufferEncode(rawId), | ||
| type: credential.type, | ||
| response: { | ||
| attestationObject: bufferEncode(attestationObject), | ||
| clientDataJSON: bufferEncode(clientDataJSON), | ||
| }, | ||
| }), | ||
| }); |
Owner
Author
There was a problem hiding this comment.
Here's the finish call for the register request. Feel free to change any of this as needed.
emoncuso
commented
Oct 19, 2022
Comment on lines
+67
to
+76
| <li class="action"> | ||
| <button | ||
| type="button" | ||
| class="link button" | ||
| disabled={{this.registerWebauthn.isRunning}} | ||
| onclick={{perform this.registerWebauthn}} | ||
| > | ||
| Register WebAuthn | ||
| </button> | ||
| </li> |
Owner
Author
emoncuso
commented
Oct 19, 2022
| disabled={{this.webauthnAuthenticate.isRunning}} | ||
| class="button is-primary {{if this.authenticate.isRunning 'is-loading'}}" | ||
| > | ||
| Sign In use WebAuthn |
Owner
Author
There was a problem hiding this comment.
If you want to change any of the button text on the sign in page, that is here.
emoncuso
commented
Oct 19, 2022
| disabled={{this.registerWebauthn.isRunning}} | ||
| onclick={{perform this.registerWebauthn}} | ||
| > | ||
| Register WebAuthn |
Owner
Author
There was a problem hiding this comment.
If you want to change any of the register text that is here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.