[Bug] Rescue error on JWT.encode (#201)
This commit is contained in:
parent
de76780ce5
commit
63ce5607e9
1 changed files with 7 additions and 3 deletions
|
@ -43,9 +43,13 @@ class WidgetsController < ActionController::Base
|
||||||
return @cookie_params if @cookie_params.present?
|
return @cookie_params if @cookie_params.present?
|
||||||
|
|
||||||
if conversation_token.present?
|
if conversation_token.present?
|
||||||
@cookie_params = JWT.decode(
|
begin
|
||||||
conversation_token, secret_key, true, algorithm: 'HS256'
|
@cookie_params = JWT.decode(
|
||||||
).first.symbolize_keys
|
conversation_token, secret_key, true, algorithm: 'HS256'
|
||||||
|
).first.symbolize_keys
|
||||||
|
rescue StandardError
|
||||||
|
@cookie_params = {}
|
||||||
|
end
|
||||||
return @cookie_params
|
return @cookie_params
|
||||||
end
|
end
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Reference in a new issue