action_auth 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/app/assets/javascripts/action_auth/application.js +5 -4
- data/app/controllers/action_auth/webauthn_credential_authentications_controller.rb +1 -8
- data/app/views/action_auth/webauthn_credential_authentications/new.html.erb +3 -7
- data/config/routes.rb +1 -3
- data/lib/action_auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59ec4916e3c5419a6e41d09f0d3ae58f01622bdc338759ceb977afeaa8f94f82
|
4
|
+
data.tar.gz: 6d4cb0b65288ba2963f3fad43aa9147d8e1e9c9139679c1378750cea74d3646a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a7183e95f4bdb6a0a8b6ec8924d67ebb945ed1510467c36b52c51550ba963d13bca21906fa7dd61bd3c90cf7087952ff9a162cecc0790bae4e3b6966fec5f8
|
7
|
+
data.tar.gz: b8a4ff19fdb107fe75b4cf96a9ac5d2b8fe9d2600522cdc6647691af1c93c69c5eb299c6c85a17c5291e218222ba50124b0a63f19f796963bf610b46939630e8
|
data/README.md
CHANGED
@@ -167,6 +167,13 @@ ActionAuth.configure do |config|
|
|
167
167
|
end
|
168
168
|
```
|
169
169
|
|
170
|
+
### Demo
|
171
|
+
|
172
|
+
Here's a view of the experience with WebAuthn
|
173
|
+
|
174
|
+
![action_auth](https://github.com/kobaltz/action_auth/assets/635114/fa88d83c-5af5-471b-a094-ec9785ea2f87)
|
175
|
+
|
176
|
+
|
170
177
|
## License
|
171
178
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
172
179
|
|
@@ -65,10 +65,11 @@ Stimulus.register(
|
|
65
65
|
Stimulus.register(
|
66
66
|
"credential-authenticator",
|
67
67
|
class extends Controller {
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
static values = { options: Object }
|
69
|
+
connect() {
|
70
|
+
if (this.hasOptionsValue) {
|
71
|
+
Credential.get(this.optionsValue);
|
72
|
+
}
|
72
73
|
}
|
73
74
|
}
|
74
75
|
);
|
@@ -4,16 +4,9 @@ class ActionAuth::WebauthnCredentialAuthenticationsController < ApplicationContr
|
|
4
4
|
layout "action_auth/application-full-width"
|
5
5
|
|
6
6
|
def new
|
7
|
-
end
|
8
|
-
|
9
|
-
def options
|
10
7
|
get_options = WebAuthn::Credential.options_for_get(allow: user.action_auth_webauthn_credentials.pluck(:external_id))
|
11
|
-
|
12
8
|
session[:current_challenge] = get_options.challenge
|
13
|
-
|
14
|
-
respond_to do |format|
|
15
|
-
format.json { render json: get_options }
|
16
|
-
end
|
9
|
+
@options = get_options
|
17
10
|
end
|
18
11
|
|
19
12
|
def create
|
@@ -1,13 +1,9 @@
|
|
1
1
|
<h2 class="">Use one of your security keys to sign in</h2>
|
2
2
|
|
3
|
-
<%=
|
4
|
-
url: options_for_webauthn_credential_authentications_path,
|
3
|
+
<%= content_tag :div,
|
5
4
|
id: "webauthn_credential_form",
|
6
|
-
data: { controller: "credential-authenticator",
|
7
|
-
|
8
|
-
<div class="mb-3">
|
9
|
-
<%= form.submit "Use Security Key", class: "btn btn-primary" %>
|
10
|
-
</div>
|
5
|
+
data: { controller: "credential-authenticator",
|
6
|
+
"credential-authenticator-options-value": @options } do %>
|
11
7
|
|
12
8
|
<div class="mb-3">
|
13
9
|
If it's an USB key be sure to insert it and, if necessary, tap it.
|
data/config/routes.rb
CHANGED
@@ -16,8 +16,6 @@ ActionAuth::Engine.routes.draw do
|
|
16
16
|
post :options, on: :collection, as: 'options_for'
|
17
17
|
end
|
18
18
|
|
19
|
-
resource :webauthn_credential_authentications, only: [:new, :create]
|
20
|
-
post :options, on: :collection, as: 'options_for'
|
21
|
-
end
|
19
|
+
resource :webauthn_credential_authentications, only: [:new, :create]
|
22
20
|
end
|
23
21
|
end
|
data/lib/action_auth/version.rb
CHANGED