Dependency Update for Ch1 Vanilla JS#85
Conversation
|
@BenBagBag - The diff for this PR is pretty noisy so I'm having trouble seeing where the differences are from main branch, are there specific sets of this change you want to call attention to for review? |
| @@ -10,13 +10,13 @@ | |||
| "author": "", | |||
| "license": "ISC", | |||
There was a problem hiding this comment.
Updated dependencies.
| authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/', // Replace the placeholder with your tenant subdomain | ||
| redirectUri: '/', // You must register this URI on Azure Portal/App Registration. Defaults to window.location.href e.g. http://localhost:3000/ | ||
| authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/', // Replace the placeholder with your tenant subdomain | ||
| redirectUri: 'http://localhost:3000/redirect', // You must register this URI on Azure Portal/App Registration. Defaults to window.location.href e.g. http://localhost:3000/ |
There was a problem hiding this comment.
Fixed the redirect URI so that the popup option works properly.
| * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/request-response-object.md#request | ||
| */ | ||
| loginRequest.redirectUri = "/redirect"; | ||
| myMSALObj.loginPopup(loginRequest) |
There was a problem hiding this comment.
Added a value to loginRequest or else this option gives a blank page after authing.
| * response returned from redirect flow. For more information, visit: | ||
| * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirect-apis | ||
| */ | ||
| myMSALObj.handleRedirectPromise() |
There was a problem hiding this comment.
Wrapped this in a promise to make sure it doesn't run before the myMSALObj is initialized.
| <!-- uncomment the above line and comment the line below if you would like to use the redirect flow --> | ||
| <script type="text/javascript" src="./authRedirect.js"></script> | ||
| <!-- comment the above line and uncomment the line below if you would like to use the popup flow --> | ||
| <!-- <script type="text/javascript" src="./authPopup.js"></script> --> |
There was a problem hiding this comment.
Made this a little clearer, as the tutorial assumes that redirect is your default, not popup.
| https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations | ||
| --> No newline at end of file | ||
| --> | ||
| <script src="/msal-browser.min.js"></script> |
There was a problem hiding this comment.
Without the script tags, the redirect page won't actually redirect.
There was a problem hiding this comment.
The original intention for this page was for it to be used in the popup flow, where MSAL polls the URL from the main window. I think it'd be worth trying to just use /redirect as the redirectUri in the popup request and leave the redirect as localhost:3000 in the redirect request. This way you can remove these scripts from this page and leave it actually blank.
| global.document.documentElement.innerHTML = html.toString(); | ||
| }); | ||
|
|
||
| it('should have valid cdn link', () => { |
There was a problem hiding this comment.
Tutorial doesn't actually use the CDN link option, so removed this test.
Also updated some file paths so that the tests pass.
|
@iambmelt Sorry, that's due to the Git issue I mentioned in Teams. I put in comments to show where the changes happened. Shouldn't happen in future commits. |
|
|
||
| // Choose which account to logout from by passing a username. | ||
| const logoutRequest = { | ||
| account: myMSALObj.getAccountByUsername(username), |
There was a problem hiding this comment.
Can you update this to use the new getAccount API, this is deprecated...
| account: myMSALObj.getAccountByUsername(username), | |
| account: myMSALObj.getAccount({ username: username }), | |
There was a problem hiding this comment.
Please make sure the change works ofc
There was a problem hiding this comment.
Updated, please take another look.
| https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations | ||
| --> No newline at end of file | ||
| --> | ||
| <script src="/msal-browser.min.js"></script> |
There was a problem hiding this comment.
The original intention for this page was for it to be used in the popup flow, where MSAL polls the URL from the main window. I think it'd be worth trying to just use /redirect as the redirectUri in the popup request and leave the redirect as localhost:3000 in the redirect request. This way you can remove these scripts from this page and leave it actually blank.
iambmelt
left a comment
There was a problem hiding this comment.
signing off as well, thanks @BenBagBag
|
@iambmelt and @hectormmg I do not have merge permissions. :) |
Purpose
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
jest testWhat to Check
Verify that the following are valid
Other Information