Class: ForestLiana::Ability::Permission::RequestPermission

Inherits:
Object
  • Object
show all
Defined in:
app/services/forest_liana/ability/permission/request_permission.rb

Class Method Summary collapse

Class Method Details

.decodeSignedApprovalRequest(params) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/services/forest_liana/ability/permission/request_permission.rb', line 7

def self.decodeSignedApprovalRequest(params)
  if (params[:data][:attributes][:signed_approval_request])
    decode_parameters = JWT.decode(params[:data][:attributes][:signed_approval_request], ForestLiana.env_secret, true, { algorithm: 'HS256' }).try(:first)

    ActionController::Parameters.new(decode_parameters)
  else
    params
  end
end