Commit ea7e9b5d authored by Sharad Heft's avatar Sharad Heft
Browse files

Allow authentication without Auth ID.

parent 81e1c17e
......@@ -23,10 +23,15 @@ class TESTOAuth2Backend(ModelBackend):
self.run_verifiers(profile)
user, _ = get_user_model().objects.get_or_create(
pk=profile['id'],
username=profile['username']
)
if getattr(settings, 'TEST_OAUTH_RESPECT_ID', False):
user, _ = get_user_model().objects.get_or_create(
pk=profile['id'],
username=profile['username']
)
else:
user, _ = get_user_model().objects.get_or_create(
username=profile['username']
)
data, _ = TESTOAuth2Data.objects.update_or_create(
user=user,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment