diff --git a/packages/wekan-accounts-sandstorm/client.js b/packages/wekan-accounts-sandstorm/client.js index 61c176fcb..695565f18 100644 --- a/packages/wekan-accounts-sandstorm/client.js +++ b/packages/wekan-accounts-sandstorm/client.js @@ -120,16 +120,20 @@ function loginWithSandstorm(connection, apiHost, apiToken) { // Send the token in an HTTP POST request which on the server side will allow us to receive the // Sandstorm headers. - HTTP.post(postUrl, - {content: token, headers: headers}, - function (error, result) { - if (error) { - console.error("couldn't get /.sandstorm-login:", error); + fetch(postUrl, { + method: 'POST', + headers: headers, + body: token + }).then(function (response) { + if (!response.ok) { + throw new Error(response.statusText); + } + }).catch(function (error) { + console.error("couldn't get /.sandstorm-login:", error); - if (waiting) { - // Try again in a second. - Meteor.setTimeout(sendXhr, 1000); - } + if (waiting) { + // Try again in a second. + Meteor.setTimeout(sendXhr, 1000); } }); }; diff --git a/packages/wekan-accounts-sandstorm/package.js b/packages/wekan-accounts-sandstorm/package.js index 190694ff5..8e8a06f64 100644 --- a/packages/wekan-accounts-sandstorm/package.js +++ b/packages/wekan-accounts-sandstorm/package.js @@ -30,7 +30,7 @@ Package.onUse(function(api) { api.use('random', ['client', 'server']); api.use('accounts-base', ['client', 'server'], {weak: true}); api.use('webapp', 'server'); - api.use('http', 'client'); + api.use('fetch', 'client'); api.use('tracker', 'client'); api.use('reactive-var', 'client'); api.use('check', 'server');