Skip to content

Commit

Permalink
[access] fix react context data paths
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Feb 4, 2024
1 parent 8f82ac5 commit feb1351
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/lib/services/nfsession/session/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def logout(self):


def _login_payload(credentials, auth_url, react_context):
country_id = react_context['models']['loginContext']['data']['geo']['requestCountry']['id']
country_id = react_context['models']['signupContext']['data']['geo']['requestCountry']['id']
country_codes = react_context['models']['countryCodes']['data']['codes']
try:
country_code = '+' + next(dict_item for dict_item in country_codes if dict_item["id"] == country_id)['code']
Expand Down Expand Up @@ -258,7 +258,7 @@ def _get_accept_language_string(react_context):
# and also influence the reactContext data (locale data and messages strings).
# Locale is usually automatically determined by the browser,
# we try get the locale code by reading the locale set as default in the reactContext.
supported_locales = react_context['models']['loginContext']['data']['geo']['supportedLocales']
supported_locales = react_context['models']['signupContext']['data']['geo']['supportedLocales']
try:
locale = next(dict_item for dict_item in supported_locales if dict_item["default"] is True)['locale']
except StopIteration:
Expand Down

0 comments on commit feb1351

Please sign in to comment.