Commit 9d4e0f16 authored by o@immerda.ch's avatar o@immerda.ch
Browse files

we now handle the urlencoded webauthn base64 in the backend

parent 9a3b1038
......@@ -258,10 +258,6 @@ class ApplicationController < ActionController::Base
session[:api_token]
end
def jsb64_tob64(str)
Base64.strict_encode64(Base64.urlsafe_decode64(str))
end
def split_pw(pw)
('<span>'+
pw.gsub(/(.{5})/,'\1</span><span>')+
......
......@@ -51,8 +51,8 @@ class TfaController < ApplicationController
if [:response, :challenge, :name, :password].all?{|e| params[e].present? }
begin
response = JSON.parse(params[:response])
attestation_object = jsb64_tob64(response.fetch("attestationObject"))
client_data_json = jsb64_tob64(response.fetch("clientDataJSON"))
attestation_object = response.fetch("attestationObject")
client_data_json = response.fetch("clientDataJSON")
api.verify_webauthn_registration(
params[:password],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment