action_auth 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da21219355f4b3f9fedb9ebd753a39468ca5e5d4f818a704acf67c99ec1f595
4
- data.tar.gz: cebdf0acc073b632b4c393b923ef4e76580f52383503ee0702d46b752099fe6a
3
+ metadata.gz: 5dfe867ff71fdec35c9997e465f8cb471a8ea57733373cec378c6117cf643a6b
4
+ data.tar.gz: 16182c5888a401678b3d2637c3b0396e8730d06d4bef1da260c34b524a3fd296
5
5
  SHA512:
6
- metadata.gz: 5eb15aaec06bcf5779e690e70acac48046a1fcbd17efc52270a4a542b2913f489c7ff8da42632ffe86f5b9860652de9aae8a76f6a54b4261923bc441d6d6ba42
7
- data.tar.gz: 405ae5545bf0d919317d4944f0c85b99dba7e5e7f7ea70d391a516838c75ff1780633da9672cf2da2474ede30e01ae5d9bd883977f18c3fbb9d036b5a0285120
6
+ metadata.gz: e2fefbcc78596506ec864843444c196aa4e580b874f73fe53676409dba0d065a57527ae92cdc7a9fc061a3da498b15af24c8618389264dcac3ba32b39461e685
7
+ data.tar.gz: 78dd9cd3b739ed973c506b94f83d6cbbfa8c228d025376b571a4f4c156a4be80b085fd9fe44ba6823cd687c926b4936869410fc1e7db0adc02ac8dd396668819
@@ -65,10 +65,12 @@ 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
+ console.log(this.optionsValue);
71
+ if (this.hasOptionsValue) {
72
+ Credential.get(this.optionsValue);
73
+ }
72
74
  }
73
75
  }
74
76
  );
@@ -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.1"
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Kimura