-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Microsoft cancelling Permission UI improvement (#775)
- Loading branch information
Showing
7 changed files
with
224 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Improve UI error messages when cancelling permissions on MicroSoft Work Account. | ||
* Update ES6 firebase/app import. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -439,6 +439,42 @@ function testHandleFederatedSignIn_popup_userCancelled() { | |
} | ||
|
||
|
||
function testHandleFederatedSignIn_popup_userCancelled_consentRequired() { | ||
// Test federated sign in with popup when user denies permissions on | ||
// Microsoft work account. | ||
app.updateConfig('signInFlow', 'popup'); | ||
// Since Microsoft's signInOptions include a loginHintKey definition, | ||
// a login_hint should be set in the customParameters. | ||
const expectedProvider = | ||
getExpectedProviderWithCustomParameters('microsoft.com', | ||
{'login_hint': '[email protected]'}); | ||
firebaseui.auth.widget.handler.handleFederatedSignIn( | ||
app, container, '[email protected]', 'microsoft.com'); | ||
assertFederatedLinkingPage(); | ||
submitForm(); | ||
// When microsoft.com consent is rejected, auth/invalid-credential is thrown. | ||
// This will get normalized to auth/user-cancelled. | ||
const invalidCredentialError = { | ||
'code': 'auth/invalid-credential', | ||
'message': 'error=consent_required', | ||
}; | ||
const expectedError = { | ||
'code': 'auth/user-cancelled', | ||
}; | ||
testAuth.assertSignInWithPopup( | ||
[expectedProvider], | ||
null, | ||
invalidCredentialError); | ||
return testAuth.process().then(function() { | ||
// Remain on same page and display the error in info bar. | ||
assertFederatedLinkingPage(); | ||
// Show error in info bar. | ||
assertInfoBarMessage( | ||
firebaseui.auth.widget.handler.common.getErrorMessage(expectedError)); | ||
}); | ||
} | ||
|
||
|
||
function testHandleFederatedSignIn_popup_popupBlockedError() { | ||
// Test federated sign in with popup when popup blocked. | ||
app.updateConfig('signInFlow', 'popup'); | ||
|
Oops, something went wrong.