diff --git a/Dockerfile b/Dockerfile index 415e9fe..b9d3948 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ FROM base AS build # Install packages needed to build gems RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config && \ + apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config libssl-dev && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives # Install application gems diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index cf116b9..126cadc 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -146,9 +146,13 @@ class SessionsController < ApplicationController begin # Generate authentication options - # The WebAuthn gem will handle base64url encoding automatically + # Decode the stored base64url credential IDs before passing to the gem + credential_ids = user.webauthn_credentials.pluck(:external_id).map do |encoded_id| + Base64.urlsafe_decode64(encoded_id) + end + options = WebAuthn::Credential.options_for_get( - allow: user.webauthn_credentials.pluck(:external_id), + allow: credential_ids, user_verification: "preferred" )