Skip to content

Commit

Permalink
move check to signup
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Oct 30, 2024
1 parent 2cbecaa commit 41e3d1f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/tacticalrmm/ee/sso/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
class TacticalSocialAdapter(DefaultSocialAccountAdapter):

def populate_user(self, request, sociallogin, data):
_, valid = token_is_valid()
if not valid:
raise PermissionDenied()

user = super().populate_user(request, sociallogin, data)
try:
provider = sociallogin.account.get_provider()
Expand All @@ -32,6 +28,13 @@ def populate_user(self, request, sociallogin, data):
)
return user

def is_open_for_signup(self, request, sociallogin):
_, valid = token_is_valid()
if not valid:
raise PermissionDenied()

return super().is_open_for_signup(request, sociallogin)

def list_providers(self, request):
core_settings = get_core_settings()
if not core_settings.sso_enabled:
Expand Down

0 comments on commit 41e3d1f

Please sign in to comment.