Skip to content

Commit 9261c8a

Browse files
committed
fixed compute
1 parent 86699f5 commit 9261c8a

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

satdigitalinvoice/localdb.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
EMAIL_TOKEN = 'email_token'
2020

2121
MozillaThunderbird_ID = '9e5f94bc-e8a4-4e73-b8be-63364c29d753'
22-
USER = ''
23-
BROWSER_NAME = None
22+
ISSUER_URI = "https://login.microsoftonline.com/common/"
23+
REDIRECT_URI = "https://localhost"
2424
SCOPES = [
2525
'https://outlook.office.com/SMTP.Send',
2626
'offline_access'
@@ -122,13 +122,24 @@ def get_email_token(self):
122122
data = self.get(EMAIL_TOKEN)
123123
data = token_refresh(
124124
refresh_token=data['refresh_token'],
125-
issuer_uri="https://login.microsoftonline.com/common/",
125+
issuer_uri=ISSUER_URI,
126126
client_id=MozillaThunderbird_ID,
127127
scopes=SCOPES
128128
)
129129
self.set_email_token(data)
130130
return data
131131

132+
def get_email_token_manual(self):
133+
token = get_token_manual(
134+
issuer_uri=ISSUER_URI,
135+
client_id=MozillaThunderbird_ID,
136+
scopes=SCOPES,
137+
login_hint='',
138+
browser_name=None,
139+
redirect_uri=REDIRECT_URI
140+
)
141+
self.set_email_token(token)
142+
132143
def solicitud_merge(self, solicitud_id, rfc, response, request=None):
133144
solicitudes = self.get_solicitudes()
134145
solicitud = solicitudes.setdefault(solicitud_id, {})
@@ -153,13 +164,3 @@ def load_data(self, file, default=None):
153164
except FileNotFoundError:
154165
return default
155166

156-
157-
def get_email_token():
158-
return get_token_manual(
159-
issuer_uri=f"https://login.microsoftonline.com/common/",
160-
client_id=MozillaThunderbird_ID,
161-
scopes=SCOPES,
162-
login_hint=USER,
163-
browser_name=BROWSER_NAME,
164-
redirect_uri="https://localhost"
165-
)

0 commit comments

Comments
 (0)