-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[msal-node][msal-common] client applications, authorization code and device code implementation #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[msal-node] lerna bootstrap and lerna builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
||
// Poll token endpoint while (device code is not expired AND operation has not been cancelled by | ||
// setting CancellationToken.cancel = true). POST request is sent at interval set by pollingIntervalMilli | ||
let intervalId: ReturnType<typeof setTimeout>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a const
defined inside the Promise
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
clearInterval(intervalId); | ||
reject(ClientAuthError.createDeviceCodeExpiredError()); | ||
|
||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early returns might make this try
bit more readable.
const fs = require('fs'); | ||
|
||
// Cookie life calculation (hours * minutes * seconds * ms) | ||
const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the units to the name? e.g. COOKIE_LIFE_MS
cookieStr += `expires=${expireTime};`; | ||
} | ||
|
||
document.cookie = cookieStr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document
doesn't exist in node, so I don't think you need the cookie logic.
…checks [msal-node] Switch strictNullChecks: true for msal-node
[msal-node][msal-common] unit tests for msal-node changes
Adds implementation public APIs and implementation for authorization code flow and device code flow. Will add a separate PR for unit tests- won't merge this until that is out and reviewed.
Adds to msal-common:
response:
request:
Add to msal-node:
Adds to samples: