lib/gatleon/rails/authform/concern.rb in gatleon-rails-0.1.10 vs lib/gatleon/rails/authform/concern.rb in gatleon-rails-0.2.0
- old
+ new
@@ -1,10 +1,11 @@
module Gatleon
module Rails
module Authform
class Concern < Module
- def initialize(form_uid:,
+ def initialize(public_key:,
+ secret_key:,
current_user_method_name: "current_user",
_authform_base_url: "https://authform.gatleon.com")
super() do
extend ActiveSupport::Concern
@@ -23,11 +24,11 @@
nil
end
end
define_method :_exchange_user_voucher_for_user do
- if params[:_authformForm] == form_uid && params[:_authformUserVoucher]
+ if params[:_authformForm] == public_key && params[:_authformUserVoucher]
# TODO: headers for api verification
uri = URI("#{_authform_base_url}/v1/exchangeUserVoucherForUser/#{params[:_authformUserVoucher]}")
response = Net::HTTP.get_response(uri)
@@ -46,10 +47,10 @@
redirect_to url, status: 302 # redirect to finish removal of query param
end
end
define_method :_authform_user_cookie_key do
- form_uid # allows for multiple forms per site
+ public_key # allows for multiple forms per site
end
end
end
end
end