Skip to content

Commit

Permalink
auth: use smtp if provider not specified in EXTERNAL_LOGINS
Browse files Browse the repository at this point in the history
  • Loading branch information
RTXUX committed Oct 23, 2024
1 parent 69328e8 commit a4e064c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/auth_providers/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ class ExternalGetCodeView(BaseGetCodeView):
provider: str

def send(self, identity, code):
use_smtp = settings.EXTERNAL_LOGINS[self.provider]['use_smtp']
url = settings.EXTERNAL_LOGINS[self.provider].get('url', None)
key = settings.EXTERNAL_LOGINS[self.provider].get('key', None)
if self.provider in settings.EXTERNAL_LOGINS:
use_smtp = settings.EXTERNAL_LOGINS[self.provider]['use_smtp']
url = settings.EXTERNAL_LOGINS[self.provider].get('url', None)
key = settings.EXTERNAL_LOGINS[self.provider].get('key', None)
else:
use_smtp = True

if settings.DEBUG or use_smtp:
EmailMessage(
Expand Down

0 comments on commit a4e064c

Please sign in to comment.