[Bug] Rescue error on JWT.encode (#201)

This commit is contained in:
Pranav Raj S 2019-11-09 16:04:02 +05:30 committed by GitHub
parent de76780ce5
commit 63ce5607e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,9 +43,13 @@ class WidgetsController < ActionController::Base
return @cookie_params if @cookie_params.present?
if conversation_token.present?
begin
@cookie_params = JWT.decode(
conversation_token, secret_key, true, algorithm: 'HS256'
).first.symbolize_keys
rescue StandardError
@cookie_params = {}
end
return @cookie_params
end
{}