feat: ms graph api mail service - #1507
Conversation
…serOfficeProject/user-office-core into feat_ms_graph_api_mail_service
…ffice-core into feat_ms_graph_api_mail_service
…serOfficeProject/user-office-core into feat_ms_graph_api_mail_service
| } | ||
|
|
||
| protected isTokenExpired(): boolean { | ||
| if (!this.authToken?.expiresOn) { |
There was a problem hiding this comment.
bug (maybe): I think this should return 'true'? If the field is missing then intuitively the token should be considered as expired... or?
| }); | ||
| } | ||
|
|
||
| protected createTransport(): NodeMailerTransportOptions | any { |
There was a problem hiding this comment.
suggestion: do we need to have 'any' here? I think we can just remove it.
| return this.authToken.accessToken; | ||
| } | ||
|
|
||
| this.authToken = await this.msalClient.acquireTokenByClientCredential({ |
There was a problem hiding this comment.
question: do you know what happens to the previous issued token, is that invalidated? The reason I'm asking is lets say there are two invocations of the function. both will await the credential, and once complete will update the class variable. If the second requiest invalidates the first requeests token then there could be a small race condition chance which will result usage of the token that is not valid.
…serOfficeProject/user-office-core into feat_ms_graph_api_mail_service
|
@gnyiri as far as I rememeber you were using SMTP mail service so we can close this PR? and reopen if ever MS Graph API becomes a needed again? |
Description
Add new MS Graph API based mail service to replace SMTP mail service.
Motivation and Context
At ELI, the SMTP mail service will be deprecated soon.
How Has This Been Tested
Manual + backend tests.
Fixes
n/a
Changes
Add MSGraphMailService class.
Depends on
n/a
Tests included/Docs Updated?