def update_user()

in moderator/moderate/auth.py [0:0]


    def update_user(self, user, claims):
        # Update user status (nda, staff based on assertions)
        profile = user.userprofile
        if username := claims.get("uid"):
            user.username = username
        email = claims.get("email")
        if email and user.email != email:
            user.email = email
        profile.avatar_url = claims.get("avatar", "")
        user.save()

        # Only staff members and members of the NDA group are allowed to login.
        # Because of this everyone will get the is_nda_member set to True.
        # If in the future more people are allowed to login this needs to be
        # available to only members of the ALLOWED_LOGIN_GROUPS
        profile.is_nda_member = True
        profile.save()
        return user