-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ | |
from sso_utils import env_var, to_list | ||
from email_helper import email_parts | ||
|
||
ENVIRONMENT = env_var("ENVIRONMENT", "development") | ||
IS_PROD = ENVIRONMENT.lower().startswith("prod") | ||
DEBUG = not IS_PROD | ||
|
||
|
||
def valid_email(email_input, client: dict = {}, debug: bool = False) -> dict: | ||
res = {"valid": False, "auth_type": None, "user_type": None} | ||
|
@@ -119,6 +123,10 @@ def get_auth_type(email) -> str: | |
if email == "[email protected]": | ||
return "email" | ||
|
||
if not IS_PROD: | ||
if email.endswith("@ncsc.gov.uk"): | ||
return "microsoft" | ||
|
||
if email.endswith("@digital.cabinet-office.gov.uk"): | ||
return "google" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters