Skip to content

Commit

Permalink
chore: update to passportxyz gmail login (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz authored Sep 12, 2024
1 parent 74b99a3 commit 431f541
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api/scorer/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
"""
This module contains functions for managing user groups and permissions in the context of social authentication.
It specifically handles group assignments for users with "@passport.xyz" email addresses.
"""

from django.contrib.auth.models import Group


def add_social_auth_user_to_group(**kwargs):
user = kwargs["user"]

# The @gitcoin.co email requirement is also enforced at the google Oauth layer
if user.email.endswith("@gitcoin.co"):
# The @passport.xyz email requirement is also enforced at the google Oauth layer
if user.email.endswith("@passport.xyz"):
admin_read_only_group = Group.objects.get(name="admin_read_only")
user.groups.add(admin_read_only_group)
user.is_staff = True
Expand Down

0 comments on commit 431f541

Please sign in to comment.