action_auth 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da21219355f4b3f9fedb9ebd753a39468ca5e5d4f818a704acf67c99ec1f595
4
- data.tar.gz: cebdf0acc073b632b4c393b923ef4e76580f52383503ee0702d46b752099fe6a
3
+ metadata.gz: 59ec4916e3c5419a6e41d09f0d3ae58f01622bdc338759ceb977afeaa8f94f82
4
+ data.tar.gz: 6d4cb0b65288ba2963f3fad43aa9147d8e1e9c9139679c1378750cea74d3646a
5
5
  SHA512:
6
- metadata.gz: 5eb15aaec06bcf5779e690e70acac48046a1fcbd17efc52270a4a542b2913f489c7ff8da42632ffe86f5b9860652de9aae8a76f6a54b4261923bc441d6d6ba42
7
- data.tar.gz: 405ae5545bf0d919317d4944f0c85b99dba7e5e7f7ea70d391a516838c75ff1780633da9672cf2da2474ede30e01ae5d9bd883977f18c3fbb9d036b5a0285120
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
- verifyKey(event) {
69
- const credentialOptions = event.detail;
70
- console.log(credentialOptions);
71
- Credential.get(credentialOptions);
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
- <%= form_with scope: :webauthn_credential_authentication,
4
- url: options_for_webauthn_credential_authentications_path,
3
+ <%= content_tag :div,
5
4
  id: "webauthn_credential_form",
6
- data: { controller: "credential-authenticator", action: "ajax:success->credential-authenticator#verifyKey" } do |form| %>
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] do
20
- post :options, on: :collection, as: 'options_for'
21
- end
19
+ resource :webauthn_credential_authentications, only: [:new, :create]
22
20
  end
23
21
  end
@@ -1,3 +1,3 @@
1
1
  module ActionAuth
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Kimura