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 +4 -4
- data/app/assets/javascripts/action_auth/application.js +6 -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: 5dfe867ff71fdec35c9997e465f8cb471a8ea57733373cec378c6117cf643a6b
|
4
|
+
data.tar.gz: 16182c5888a401678b3d2637c3b0396e8730d06d4bef1da260c34b524a3fd296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
69
|
-
|
70
|
-
console.log(
|
71
|
-
|
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
|
-
<%=
|
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