Skip to content

Commit

Permalink
fix chatly cookie (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadali124 authored Jul 4, 2024
1 parent 9fa09ef commit c48933b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions openedx/features/edly/chatly_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ def get_chatly_token_from_cookie(request):
chatly_token: string
"""
eval_string = "None"
if CHATLY_COOKIE_NAME in request.COOKIES:
chatly_token = request.COOKIES[CHATLY_COOKIE_NAME]
eval_string = "None"
else:
chatly_token = obtain_token_from_chatly()
eval_string = (
f'response.set_cookie({CHATLY_COOKIE_NAME}, chatly_token, max_age=604600)'
)
if chatly_token:
eval_string = (
f'response.set_cookie("{CHATLY_COOKIE_NAME}", chatly_token, max_age=604600)'
)

return eval_string, chatly_token

Expand Down

0 comments on commit c48933b

Please sign in to comment.