Source code for squaresdb.utils.socialauth
from django.http import HttpResponse
from django.urls import reverse
from social_django.utils import load_strategy, load_backend
from social_core.storage import UserMixin
[docs]
def clean_saml_username(username):
# Note that this can be called with email+UUID (and the email might be
# from Touchstone Collab), which is why don't just trim the end.
end = '@mit.edu'
if username.endswith(end):
username = username[:-len(end)]
return UserMixin.clean_username(username)