From 9844bf5e36dae414062cd2b4c81f8a137b4a66c0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Mon, 13 Feb 2023 12:25:30 -0300 Subject: [PATCH] meteor services are now async --- tools/meteor-services/auth-client.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/meteor-services/auth-client.js b/tools/meteor-services/auth-client.js index ef751671c4..382645f387 100644 --- a/tools/meteor-services/auth-client.js +++ b/tools/meteor-services/auth-client.js @@ -50,10 +50,10 @@ exports.handleConnectionError = function (error, label) { // domain: the domain (ex: packages.meteor.com) // sessionType: the name of the connection (ex: "package-server") // -exports.loggedInConnection = function (url, domain, sessionType) { +exports.loggedInConnection = async function (url, domain, sessionType) { // Make sure that we are logged in with Meteor Accounts so that we can // do an OAuth flow. - if (auth.maybePrintRegistrationLink({onlyAllowIfRegistered: true})) { + if (await auth.maybePrintRegistrationLink({ onlyAllowIfRegistered: true })) { // Oops, we're logged in but with a deferred-registration account. // Message has already been printed. throw new exports.AlreadyPrintedMessageError; @@ -65,13 +65,13 @@ exports.loggedInConnection = function (url, domain, sessionType) { "Please log in with your Meteor developer account.", "If you don't have one,", "you can quickly create one at www.meteor.com."); - auth.doUsernamePasswordLogin({ retry: true }); + await auth.doUsernamePasswordLogin({ retry: true }); } - var conn = exports.openServiceConnection(url); - var accountsConfiguration = auth.getAccountsConfiguration(conn); + var conn = await exports.openServiceConnection(url); + var accountsConfiguration = await auth.getAccountsConfiguration(conn); try { - auth.loginWithTokenOrOAuth( + await auth.loginWithTokenOrOAuth( conn, accountsConfiguration, url, @@ -86,8 +86,8 @@ exports.loggedInConnection = function (url, domain, sessionType) { "It looks like you have been logged out!", "Please log in with your Meteor developer account. If you don't have", "one, you can quickly create one at www.meteor.com."); - auth.doUsernamePasswordLogin({ retry: true }); - auth.loginWithTokenOrOAuth( + await auth.doUsernamePasswordLogin({ retry: true }); + await auth.loginWithTokenOrOAuth( conn, accountsConfiguration, url,