diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-01-30 17:56:53 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-01-30 17:56:53 +0200 |
commit | 9703843602c710a3c8848e9b07e46126a3ae8146 (patch) | |
tree | c4b4c26e94d087314abe47d4e3c5b7e361868634 | |
parent | d53a7ce5f19b940c28bfaba09b887c73ba164211 (diff) | |
download | wekan-9703843602c710a3c8848e9b07e46126a3ae8146.tar.gz wekan-9703843602c710a3c8848e9b07e46126a3ae8146.tar.bz2 wekan-9703843602c710a3c8848e9b07e46126a3ae8146.zip |
- Revert [Sandstorm API changes](https://github.com/wekan/wekan/commit/be03a191c4321c2f80116c0ee1ae6c826d882535
that were done at [Wekan v2.05](https://github.com/wekan/wekan/blob/devel/CHANGELOG.md#v205-2019-01-27-wekan-release)
to fix #2143.
Thanks to pantraining and xet7 !
Closes #2143
-rw-r--r-- | sandstorm-pkgdef.capnp | 2 | ||||
-rw-r--r-- | server/authentication.js | 21 |
2 files changed, 1 insertions, 22 deletions
diff --git a/sandstorm-pkgdef.capnp b/sandstorm-pkgdef.capnp index 78c35eb5..c25385ca 100644 --- a/sandstorm-pkgdef.capnp +++ b/sandstorm-pkgdef.capnp @@ -226,7 +226,7 @@ const pkgdef :Spk.PackageDefinition = ( verbPhrase = (defaultText = "removed from card"), ), ], ), - apiPath = "/api", + apiPath = "/", saveIdentityCaps = true, ), ); diff --git a/server/authentication.js b/server/authentication.js index d0d71e4d..4d3cc53e 100644 --- a/server/authentication.js +++ b/server/authentication.js @@ -17,27 +17,6 @@ Meteor.startup(() => { Authentication.checkUserId = function (userId) { if (userId === undefined) { - // Monkey patch to work around the problem described in - // https://github.com/sandstorm-io/meteor-accounts-sandstorm/pull/31 - const _httpMethods = HTTP.methods; - HTTP.methods = (newMethods) => { - Object.keys(newMethods).forEach((key) => { - if (newMethods[key].auth) { - newMethods[key].auth = function() { - const sandstormID = this.req.headers['x-sandstorm-user-id']; - const user = Meteor.users.findOne({'services.sandstorm.id': sandstormID}); - if (user) { - userId = user._id; - } - //return user && user._id; - }; - } - }); - _httpMethods(newMethods); - }; - } - - if (userId === undefined) { const error = new Meteor.Error('Unauthorized', 'Unauthorized'); error.statusCode = 401; throw error; |