mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
office365-imap: update token path
This commit is contained in:
parent
1325482389
commit
2322c31913
1 changed files with 6 additions and 1 deletions
|
|
@ -65,6 +65,7 @@
|
|||
# )
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
|
@ -97,7 +98,11 @@ class Office365Transport(EmailTransport):
|
|||
|
||||
credentials = (settings.MICROSOFT_O365_CLIENT_ID, settings.MICROSOFT_O365_CLIENT_SECRET)
|
||||
|
||||
self.account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=settings.MICROSOFT_O365_TENENT_ID)
|
||||
if not os.path.isdir(settings.O365_TOKEN_PATH):
|
||||
os.mkdir(settings.O365_TOKEN_PATH)
|
||||
|
||||
token_path=os.path.join(settings.O365_TOKEN_PATH, 'token.txt')
|
||||
self.account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=settings.MICROSOFT_O365_TENENT_ID, token_path=token_path)
|
||||
self.account.authenticate()
|
||||
|
||||
self.mailbox = self.account.mailbox(resource=self.username)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue