mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
meteor services are now async
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user