Skip to content

Commit

Permalink
Ensure user is successfully authenticated with OAuth2 when optional p…
Browse files Browse the repository at this point in the history
…arameters are missing oauth2 config.pgadmin-org#7965
  • Loading branch information
yogeshmahajan-1903 committed Sep 25, 2024
1 parent 0ab5e0d commit 2f0e161
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions web/pgadmin/templates/security/login_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
{% set _ = ns.langOptions.append({'value': key, 'label': lang}) %}
{% endfor %}
{% set oauth2_config = [] %}
{% for i in config.OAUTH2_CONFIG %}
{% set _tmp = oauth2_config.append({'OAUTH2_NAME': config.OAUTH2_CONFIG[loop.index-1]['OAUTH2_NAME'],
'OAUTH2_BUTTON_COLOR': config.OAUTH2_CONFIG[loop.index-1]['OAUTH2_BUTTON_COLOR'],
'OAUTH2_DISPLAY_NAME': config.OAUTH2_CONFIG[loop.index-1]['OAUTH2_DISPLAY_NAME'],
'OAUTH2_ICON': config.OAUTH2_CONFIG[loop.index-1]['OAUTH2_ICON']
}) %}
{% set oauth2_config_to_be_included = ['OAUTH2_NAME', 'OAUTH2_DISPLAY_NAME', 'OAUTH2_ICON', 'OAUTH2_BUTTON_COLOR' ] %}
{% for oauth_client in config.OAUTH2_CONFIG %}
{% set _tmp = [] %}
{% for key, value in oauth_client.items() %}
{% if key in oauth2_config_to_be_included %}
{% set _ = _tmp.append((key, value)) %}
{% endif %}
{% endfor %}
{% set _ = oauth2_config.append(dict.from_keys(_tmp)) %}
{% endfor %}

{% set page_props = {
Expand Down

0 comments on commit 2f0e161

Please sign in to comment.