mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
ruby: config request JWT used in functions
This commit is contained in:
@ -59,7 +59,7 @@ class ServiceConverter
|
||||
req.add_field("Accept", "application/json") # set headers
|
||||
req.add_field("Content-Type", "application/json")
|
||||
|
||||
if JwtHelper.is_enabled # if the signature is enabled
|
||||
if JwtHelper.is_enabled && JwtHelper.use_for_request # if the signature is enabled
|
||||
payload["token"] = JwtHelper.encode(payload) # get token and save it to the payload
|
||||
jwtHeader = Rails.configuration.header.empty? ? "Authorization" : Rails.configuration.header; # get signature authorization header
|
||||
req.add_field(jwtHeader, "Bearer #{JwtHelper.encode({ :payload => payload })}") # set it to the request with the Bearer prefix
|
||||
|
||||
Reference in New Issue
Block a user