Merge "Add auth_type to template context for openrc file rendering"

This commit is contained in:
Zuul 2020-04-14 15:07:43 +00:00 committed by Gerrit Code Review
commit ffc83664d3
3 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ def unset_session_user_variables(request):
request.session['user_id'] = None
request.session['region_endpoint'] = None
request.session['services_region'] = None
request.session['auth_type'] = None
# Update the user object cached in the request
request._cached_user = None
request.user = None

View File

@ -69,6 +69,7 @@ def login(request):
# from the dropdown, We need to redirect user to the websso url
if request.method == 'POST':
auth_type = request.POST.get('auth_type', 'credentials')
request.session['auth_type'] = auth_type
if utils.is_websso_enabled() and auth_type != 'credentials':
region_id = request.POST.get('region')
auth_url = getattr(settings, 'WEBSSO_KEYSTONE_URL', None)

View File

@ -80,6 +80,7 @@ def _get_openrc_credentials(request):
'user': request.user,
'interface': 'public',
'os_endpoint_type': 'publicURL',
'auth_type': request.session.get('auth_type'),
'region': getattr(request.user, 'services_region') or "",
}