From acbac901c25f5c5b3325cf3c4d52af0ec763f7a2 Mon Sep 17 00:00:00 2001 From: Xin Li Date: Mon, 2 Nov 2020 16:42:06 -0800 Subject: [PATCH] fix: Microsoft cancelling Permission UI improvement (#775) --- CHANGELOG.md | 2 + javascript/widgets/handler/callback.js | 43 ++- javascript/widgets/handler/callback_test.js | 27 ++ javascript/widgets/handler/common.js | 31 +- .../widgets/handler/federatedsignin_test.js | 36 ++ package-lock.json | 308 ++++++------------ soy/strings.soy | 5 +- 7 files changed, 224 insertions(+), 228 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29b..2a32b0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +* Improve UI error messages when cancelling permissions on MicroSoft Work Account. +* Update ES6 firebase/app import. \ No newline at end of file diff --git a/javascript/widgets/handler/callback.js b/javascript/widgets/handler/callback.js index 8b014227..220d6081 100644 --- a/javascript/widgets/handler/callback.js +++ b/javascript/widgets/handler/callback.js @@ -52,31 +52,37 @@ firebaseui.auth.widget.handler.handleCallback = firebaseui.auth.widget.handler.handleCallbackResult_(app, component, result); }, function(error) { + // Normalize the error. + const normalizedError = + firebaseui.auth.widget.handler.common.normalizeError(error); // A previous redirect operation was triggered and some error occurred. // Test for need confirmation error and handle appropriately. // For all other errors, display info bar and show sign in screen. - if (error && + if (normalizedError && // Single out need confirmation error as email-already-in-use and // credential-already-in-use will also return email and credential // and need to be handled differently. - (error['code'] == 'auth/account-exists-with-different-credential' || - error['code'] == 'auth/email-already-in-use') && - error['email'] && - error['credential']) { + (normalizedError['code'] == + 'auth/account-exists-with-different-credential' || + normalizedError['code'] == 'auth/email-already-in-use') && + normalizedError['email'] && + normalizedError['credential']) { // Save pending email credential. firebaseui.auth.storage.setPendingEmailCredential( new firebaseui.auth.PendingEmailCredential( - error['email'], error['credential']), + normalizedError['email'], normalizedError['credential']), app.getAppId()); firebaseui.auth.widget.handler.handleCallbackLinking_( - app, component, error['email']); - } else if (error && error['code'] == 'auth/user-cancelled') { + app, component, normalizedError['email']); + } else if (normalizedError && + normalizedError['code'] == 'auth/user-cancelled') { // Should go back to the previous linking screen. A pending email // should be present, otherwise there's an error. - var pendingCredential = + const pendingCredential = firebaseui.auth.storage.getPendingEmailCredential(app.getAppId()); - var message = - firebaseui.auth.widget.handler.common.getErrorMessage(error); + const message = + firebaseui.auth.widget.handler.common.getErrorMessage( + normalizedError); // If there is a credential too, then the previous screen was federated // linking so we process the error as a linking flow. if (pendingCredential && pendingCredential.getCredential()) { @@ -92,14 +98,17 @@ firebaseui.auth.widget.handler.handleCallback = } else { // Go to the sign-in page with info bar error. firebaseui.auth.widget.handler.handleCallbackFailure_( - app, component, /** @type {!Error} */ (error)); + app, component, /** @type {!Error} */ (normalizedError)); } - } else if (error && error['code'] == 'auth/credential-already-in-use') { + } else if (normalizedError && + normalizedError['code'] == 'auth/credential-already-in-use') { // Do nothing and keep callback UI while onUpgradeError catches and // handles this error. - } else if (error && - error['code'] == 'auth/operation-not-supported-in-this-environment' && - firebaseui.auth.widget.handler.common.isPasswordProviderOnly(app)) { + } else if (normalizedError && + normalizedError['code'] == + 'auth/operation-not-supported-in-this-environment' && + firebaseui.auth.widget.handler.common.isPasswordProviderOnly( + app)) { // Operation is not supported in this environment but only password // provider is enabled. So allow this to proceed as a no redirect result. // This will allow developers using password sign-in in Cordova to use @@ -114,7 +123,7 @@ firebaseui.auth.widget.handler.handleCallback = } else { // Go to the sign-in page with info bar error. firebaseui.auth.widget.handler.handleCallbackFailure_( - app, component, /** @type {!Error} */ (error)); + app, component, /** @type {!Error} */ (normalizedError)); } })); }; diff --git a/javascript/widgets/handler/callback_test.js b/javascript/widgets/handler/callback_test.js index d0a5171b..aba017bb 100644 --- a/javascript/widgets/handler/callback_test.js +++ b/javascript/widgets/handler/callback_test.js @@ -1961,6 +1961,33 @@ function testHandleCallback_redirectError_userCancelled_noPendingCredential() { } +function testHandleCallback_redirectError_consentRequired_invalidCredential() { + asyncTestCase.waitForSignals(1); + // Attempting to get redirect result. Special case error message equals + // consent_required. Reject with the user cancelled error. + const invalidCredentialError = { + 'code': 'auth/invalid-credential', + 'message': 'error=consent_required', + }; + const expectedError = { + 'code': 'auth/user-cancelled', + }; + testAuth.assertGetRedirectResult([], null, invalidCredentialError); + // Callback rendered. + firebaseui.auth.widget.handler.handleCallback(app, container); + assertCallbackPage(); + testAuth.process().then(function() { + // Redirects to the federated sign-in page. + assertProviderSignInPage(); + // Confirm expected error shown in info bar. + assertInfoBarMessage( + firebaseui.auth.widget.handler.common.getErrorMessage( + expectedError)); + asyncTestCase.signal(); + }); +} + + function testHandleCallback_nullUser() { // Test when no previous sign-in with redirect is detected and provider sign // in page is rendered. diff --git a/javascript/widgets/handler/common.js b/javascript/widgets/handler/common.js index 6dc12d95..7e1a6542 100644 --- a/javascript/widgets/handler/common.js +++ b/javascript/widgets/handler/common.js @@ -48,6 +48,27 @@ goog.require('goog.array'); */ firebaseui.auth.OAuthResponse; +/** + * Normalizes the error. This is useful for mapping certain errors to different + * errors. + * When no mapping is needed, the same error is returned. + * This is currently used to map 'auth/invalid-credential' code to + * 'auth/user-cancelled' when users do not grant access permission to + * Microsoft work account. + * @param {*} error The original error. + * @return {*} The normalized error. + * @package + */ +firebaseui.auth.widget.handler.common.normalizeError = + function(error) { + if (error['code'] === 'auth/invalid-credential' && + error['message'] && + error['message'].indexOf('error=consent_required') !== -1) { + return {code: 'auth/user-cancelled'}; + } + return error; +}; + /** * Sets the user as signed in with Auth result. Signs in on external Auth * instance if not already signed in and then invokes @@ -513,7 +534,10 @@ firebaseui.auth.widget.handler.common.federatedSignIn = function( if (error['name'] && error['name'] == 'cancel') { return; } - switch (error['code']) { + // Normalize the error. + const normalizedError = + firebaseui.auth.widget.handler.common.normalizeError(error); + switch (normalizedError['code']) { case 'auth/popup-blocked': // Popup blocked, switch to redirect flow as fallback. processRedirect(); @@ -533,7 +557,8 @@ firebaseui.auth.widget.handler.common.federatedSignIn = function( // For no action errors like network error, just display in info // bar in current component. A second attempt could still work. component.showInfoBar( - firebaseui.auth.widget.handler.common.getErrorMessage(error)); + firebaseui.auth.widget.handler.common.getErrorMessage( + normalizedError)); break; default: // Either linking required errors or errors that are @@ -543,7 +568,7 @@ firebaseui.auth.widget.handler.common.federatedSignIn = function( firebaseui.auth.widget.HandlerName.CALLBACK, app, container, - goog.Promise.reject(error)); + goog.Promise.reject(normalizedError)); break; } }; diff --git a/javascript/widgets/handler/federatedsignin_test.js b/javascript/widgets/handler/federatedsignin_test.js index 875e09d8..b85db54f 100644 --- a/javascript/widgets/handler/federatedsignin_test.js +++ b/javascript/widgets/handler/federatedsignin_test.js @@ -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': 'user@outlook.com'}); + firebaseui.auth.widget.handler.handleFederatedSignIn( + app, container, 'user@outlook.com', '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'); diff --git a/package-lock.json b/package-lock.json index 76e9bda9..b6787a40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,9 +46,9 @@ "dev": true }, "@firebase/auth": { - "version": "0.14.9", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.14.9.tgz", - "integrity": "sha512-PxYa2r5qUEdheXTvqROFrMstK8W4uPiP7NVfp+2Bec+AjY5PxZapCx/YFDLkU0D7YBI82H74PtZrzdJZw7TJ4w==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.15.0.tgz", + "integrity": "sha512-IFuzhxS+HtOQl7+SZ/Mhaghy/zTU7CENsJFWbC16tv2wfLZbayKF5jYGdAU3VFLehgC8KjlcIWd10akc3XivfQ==", "dev": true, "requires": { "@firebase/auth-types": "0.10.1" @@ -101,16 +101,16 @@ } }, "@firebase/firestore": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.17.3.tgz", - "integrity": "sha512-wRdrgeSBJ50eo63x8GnO8NgVNe3vBw2xhKhyMXl0JTWQIbxnlMjAHcz7b85VvsqPLI7U70PgWQnfQtJOXRCNUA==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.18.0.tgz", + "integrity": "sha512-maMq4ltkrwjDRusR2nt0qS4wldHQMp+0IDSfXIjC+SNmjnWY/t/+Skn9U3Po+dB38xpz3i7nsKbs+8utpDnPSw==", "dev": true, "requires": { "@firebase/component": "0.1.19", - "@firebase/firestore-types": "1.13.0", + "@firebase/firestore-types": "1.14.0", "@firebase/logger": "0.2.6", "@firebase/util": "0.3.2", - "@firebase/webchannel-wrapper": "0.3.0", + "@firebase/webchannel-wrapper": "0.4.0", "@grpc/grpc-js": "^1.0.0", "@grpc/proto-loader": "^0.5.0", "node-fetch": "2.6.1", @@ -118,9 +118,9 @@ } }, "@firebase/firestore-types": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-1.13.0.tgz", - "integrity": "sha512-QF5CAuYOHE6Zbsn1uEg6wkl836iP+i6C0C/Zs3kF60eebxZvTWp8JSZk19Ar+jj4w+ye8/7H5olu5CqDNjWpEA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-1.14.0.tgz", + "integrity": "sha512-WF8IBwHzZDhwyOgQnmB0pheVrLNP78A8PGxk1nxb/Nrgh1amo4/zYvFMGgSsTeaQK37xMYS/g7eS948te/dJxw==", "dev": true }, "@firebase/functions": { @@ -266,9 +266,9 @@ } }, "@firebase/webchannel-wrapper": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.3.0.tgz", - "integrity": "sha512-VniCGPIgSGNEgOkh5phb3iKmSGIzcwrccy3IomMFRWPCMiCk2y98UQNJEoDs1yIHtZMstVjYWKYxnunIGzC5UQ==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.4.0.tgz", + "integrity": "sha512-8cUA/mg0S+BxIZ72TdZRsXKBP5n5uRcE3k29TZhZw6oIiHBt9JA7CTb/4pE1uKtE/q5NeTY2tBDcagoZ+1zjXQ==", "dev": true }, "@google-cloud/paginator": { @@ -454,9 +454,9 @@ } }, "@grpc/grpc-js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.1.7.tgz", - "integrity": "sha512-EuxMstI0u778dp0nk6Fe3gHXYPeV6FYsWOe0/QFwxv1NQ6bc5Wl/0Yxa4xl9uBlKElL6AIxuASmSfu7KEJhqiw==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.1.8.tgz", + "integrity": "sha512-64hg5rmEm6F/NvlWERhHmmgxbWU8nD2TMWE+9TvG7/WcOrFT3fzg/Uu631pXRFwmJ4aWO/kp9vVSlr8FUjBDLA==", "dev": true, "requires": { "@grpc/proto-loader": "^0.6.0-pre14", @@ -479,9 +479,9 @@ } }, "@types/node": { - "version": "12.12.67", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.67.tgz", - "integrity": "sha512-R48tgL2izApf+9rYNH+3RBMbRpPeW3N8f0I9HMhggeq4UXwBDqumJ14SDs4ctTMhG11pIOduZ4z3QWGOiMc9Vg==", + "version": "12.19.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.3.tgz", + "integrity": "sha512-8Jduo8wvvwDzEVJCOvS/G6sgilOLvvhn1eMmK3TW8/T217O7u1jdrK6ImKLv80tVryaPSVeKu6sjDEiFjd4/eg==", "dev": true } } @@ -591,9 +591,9 @@ "dev": true }, "@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", "dev": true }, "@types/q": { @@ -673,9 +673,9 @@ "dev": true }, "agent-base": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", - "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "requires": { "debug": "4" @@ -876,13 +876,13 @@ } }, "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.0.tgz", + "integrity": "sha512-cd+5r1VLBwUqTrmnzW+D7ABkJUM6mr7uv1dv+6jRw4Rcl7tFIFHDqHPL98LhpGFn3dbAt3gtLxtrWp4m1kFrqg==", "dev": true, "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, "glob": { @@ -1266,9 +1266,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "axios": { @@ -2023,6 +2023,16 @@ "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", "dev": true }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -3494,37 +3504,6 @@ "is-arrayish": "^0.2.1" } }, - "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, "es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", @@ -4104,17 +4083,17 @@ } }, "firebase": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.23.0.tgz", - "integrity": "sha512-0b1zi0H8jT4KqyPabldzPhyKTeptw5E5a7KkjWW3MBMVV/LjbC6/NKhRR8sGQNbsbS2LnTvyEENWbqkZP2ZXtw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.24.0.tgz", + "integrity": "sha512-j6jIyGFFBlwWAmrlUg9HyQ/x+YpsPkc/TTkbTyeLwwAJrpAmmEHNPT6O9xtAnMV4g7d3RqLL/u9//aZlbY4rQA==", "dev": true, "requires": { "@firebase/analytics": "0.6.0", "@firebase/app": "0.6.11", "@firebase/app-types": "0.6.1", - "@firebase/auth": "0.14.9", + "@firebase/auth": "0.15.0", "@firebase/database": "0.6.13", - "@firebase/firestore": "1.17.3", + "@firebase/firestore": "1.18.0", "@firebase/functions": "0.5.1", "@firebase/installations": "0.4.17", "@firebase/messaging": "0.7.1", @@ -4523,9 +4502,9 @@ } }, "gaxios": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-3.2.0.tgz", - "integrity": "sha512-+6WPeVzPvOshftpxJwRi2Ozez80tn/hdtOUag7+gajDHRJvAblKxTFSSMPtr2hmnLy7p0mvYz0rMXLBl8pSO7Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.0.1.tgz", + "integrity": "sha512-jOin8xRZ/UytQeBpSXFqIzqU7Fi5TqgPNLlUsSB8kjJ76+FiGBfImF8KJu++c6J4jOldfJUtt0YmkRj2ZpSHTQ==", "dev": true, "requires": { "abort-controller": "^3.0.0", @@ -4553,12 +4532,12 @@ } }, "gcp-metadata": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.0.tgz", - "integrity": "sha512-vQZD57cQkqIA6YPGXM/zc+PIZfNRFdukWGsGZ5+LcJzesi5xp6Gn7a02wRJi4eXPyArNMIYpPET4QMxGqtlk6Q==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", "dev": true, "requires": { - "gaxios": "^3.0.0", + "gaxios": "^4.0.0", "json-bigint": "^1.0.0" } }, @@ -4584,6 +4563,17 @@ "import-regex": "^1.1.0" } }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -4970,17 +4960,17 @@ } }, "google-auth-library": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.1.tgz", - "integrity": "sha512-0WfExOx3FrLYnY88RICQxvpaNzdwjz44OsHqHkIoAJfjY6Jck6CZRl1ASWadk+wbJ0LhkQ8rNY4zZebKml4Ghg==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.3.tgz", + "integrity": "sha512-m9mwvY3GWbr7ZYEbl61isWmk+fvTmOt0YNUfPOUY2VH8K5pZlAIWJjxEi0PqR3OjMretyiQLI6GURMrPSwHQ2g==", "dev": true, "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "fast-text-encoding": "^1.0.0", - "gaxios": "^3.0.0", - "gcp-metadata": "^4.1.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", "gtoken": "^5.0.4", "jws": "^4.0.0", "lru-cache": "^6.0.0" @@ -5371,12 +5361,12 @@ "dev": true }, "gtoken": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.0.4.tgz", - "integrity": "sha512-U9wnSp4GZ7ov6zRdPuRHG4TuqEWqRRgT1gfXGNArhzBUn9byrPeH8uTmBWU/ZiWJJvTEmkjhDIC3mqHWdVi3xQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.0.5.tgz", + "integrity": "sha512-wvjkecutFh8kVfbcdBdUWqDRrXb+WrgD79DBDEYf1Om8S1FluhylhtFjrL7Tx69vNhh259qA3Q1P4sPtb+kUYw==", "dev": true, "requires": { - "gaxios": "^3.0.0", + "gaxios": "^4.0.0", "google-p12-pem": "^3.0.3", "jws": "^4.0.0", "mime": "^2.2.0" @@ -6484,9 +6474,9 @@ "dev": true }, "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, "immediate": { @@ -6769,12 +6759,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", - "dev": true - }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -6784,6 +6768,15 @@ "ci-info": "^1.5.0" } }, + "is-core-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.0.0.tgz", + "integrity": "sha512-jq1AH6C8MuteOoBPwkxHafmByhL9j5q4OaPGdbuD+ZtQJVzH+i6E3BJDQcBA09k57i2Hh2yQbEG8yObZ0jdlWw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -6804,12 +6797,6 @@ } } }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", - "dev": true - }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -6884,12 +6871,6 @@ "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, - "is-negative-zero": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", - "dev": true - }, "is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", @@ -6953,15 +6934,6 @@ "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", @@ -6989,15 +6961,6 @@ "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==", "dev": true }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -7213,9 +7176,9 @@ "dev": true }, "jsonschema": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.11.tgz", - "integrity": "sha512-XNZHs3N1IOa3lPKm//npxMhOdaoPw+MvEV0NIgxcER83GTJcG13rehtWmpBCfEt8DrtYwIkMTs8bdXoYs4fvnQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.0.tgz", + "integrity": "sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw==", "dev": true }, "jsonwebtoken": { @@ -8794,12 +8757,6 @@ } } }, - "object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", - "dev": true - }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -8816,13 +8773,13 @@ } }, "object.assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", - "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "requires": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.0", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" } @@ -9439,9 +9396,9 @@ }, "dependencies": { "@types/node": { - "version": "13.13.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.25.tgz", - "integrity": "sha512-6ZMK4xRcF2XrPdKmPYQxZkdHKV18xKgUFVvhIgw2iwaaO6weleLPHLBGPZmLhjo+m1N+MZXRAoBEBCCVqgO2zQ==", + "version": "13.13.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.30.tgz", + "integrity": "sha512-HmqFpNzp3TSELxU/bUuRK+xzarVOAsR00hzcvM0TXrMlt/+wcSLa5q6YhTb6/cA6wqDCZLDcfd8fSL95x5h7AA==", "dev": true } } @@ -9903,11 +9860,12 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", + "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==", "dev": true, "requires": { + "is-core-module": "^2.0.0", "path-parse": "^1.0.6" }, "dependencies": { @@ -11058,68 +11016,6 @@ } } }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } - } - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", diff --git a/soy/strings.soy b/soy/strings.soy index cd64dec2..844300a7 100644 --- a/soy/strings.soy +++ b/soy/strings.soy @@ -239,8 +239,8 @@ {case 'auth/user-token-expired'} {call .errorLoginAgain_ /} {case 'auth/weak-password'} - {msg desc="Error message for when the user tries to sign in or sign up with a password that - is too short."} + {msg desc="Error message for when the user tries to sign in or sign up with a password that is + too short."} Strong passwords have at least 6 characters and a mix of letters and numbers {/msg} {case 'auth/wrong-password'} @@ -272,6 +272,7 @@ The action code is invalid. This can happen if the code is malformed, expired, or has already been used. {/msg} + {default} {/switch} {/template}