Skip to content

Commit

Permalink
Fix import of @github/webauthn-json and tidy some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMacNaughton committed Nov 5, 2023
1 parent 913ae16 commit b0d9dc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/assets/javascripts/new_webauthn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as WebAuthnJSON from "./@github/webauthn-json"
// import { showMessage } from "messenger";

//= require @github/webauthn-json

function getCSRFToken() {
var CSRFSelector = document.querySelector('meta[name="csrf-token"]')
Expand Down Expand Up @@ -34,20 +32,18 @@ function callback(url, body, redirect_url) {
}

function create_webauthn(callbackUrl, credentialOptions) {
WebAuthnJSON.create({ "publicKey": credentialOptions }).then(function(credential) {
create({ "publicKey": credentialOptions }).then(function(credential) {
callback(callbackUrl, credential, "/profile/authentication_devices");
}).catch(function(error) {
$('#init-error').toggle();
console.log(error);

});

console.log("Creating new public key credential...");
}

function get_webauthn(credentialOptions) {
console.log(credentialOptions)
WebAuthnJSON.get({ "publicKey": credentialOptions }).then(function(credential) {
get({ "publicKey": credentialOptions }).then(function(credential) {
console.log(credential)
callback(`/users/sign_in?user[remember_me]=${remember_me}`, credential, "/");
}).catch(function(error) {
Expand Down
Binary file added dump.rdb
Binary file not shown.

0 comments on commit b0d9dc2

Please sign in to comment.