diff --git a/inbox/api/srv.py b/inbox/api/srv.py index b31a104f8..a05a088ef 100644 --- a/inbox/api/srv.py +++ b/inbox/api/srv.py @@ -21,6 +21,7 @@ from inbox.models import Account, Namespace from inbox.models.backends.generic import GenericAccount from inbox.models.backends.gmail import GOOGLE_EMAIL_SCOPE, GmailAccount +from inbox.models.backends.outlook import OutlookAccount from inbox.models.secret import SecretType from inbox.models.session import global_session_scope from inbox.util.logging_helper import reconfigure_logging @@ -277,6 +278,9 @@ def modify_account(namespace_public_id): elif isinstance(account, GmailAccount): auth_handler = GoogleAuthHandler() account_data = _get_account_data_for_google_account(data) + elif isinstance(account, OutlookAccount): + auth_handler = MicrosoftAuthHandler() + account_data = _get_account_data_for_microsoft_account(data) else: raise ValueError("Account type not supported.") diff --git a/inbox/models/backends/oauth.py b/inbox/models/backends/oauth.py index ae8b55dad..72c3cb6d0 100644 --- a/inbox/models/backends/oauth.py +++ b/inbox/models/backends/oauth.py @@ -2,7 +2,6 @@ Generic OAuth class that provides abstraction for access and refresh tokens. """ -import json from datetime import datetime, timedelta from nylas.logging import get_logger @@ -10,6 +9,7 @@ from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship +from inbox.basicauth import OAuthError from inbox.models.secret import Secret, SecretType log = get_logger()