Change third party auth login failure code to a 401, to detect authentication success with no linked account. If already authenticated, redirect immediately to the dashboard. Use "Location" header correctly for 302 redirects from student views. Add utility functions for simulating a running third-party auth pipeline. Add a utility function for checking whether third party auth is enabled. Respect default values sent by the server
16 lines
420 B
Python
16 lines
420 B
Python
"""Third party authentication. """
|
|
|
|
from microsite_configuration import microsite
|
|
|
|
|
|
def is_enabled():
|
|
"""Check whether third party authentication has been enabled. """
|
|
|
|
# We do this imports internally to avoid initializing settings prematurely
|
|
from django.conf import settings
|
|
|
|
return microsite.get_value(
|
|
"ENABLE_THIRD_PARTY_AUTH",
|
|
settings.FEATURES.get("ENABLE_THIRD_PARTY_AUTH")
|
|
)
|