瀏覽代碼

- 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

Lauri Ojansivu 6 年之前
父節點
當前提交
9703843602
共有 2 個文件被更改,包括 1 次插入22 次删除
  1. 1 1
      sandstorm-pkgdef.capnp
  2. 0 21
      server/authentication.js

+ 1 - 1
sandstorm-pkgdef.capnp

@@ -226,7 +226,7 @@ const pkgdef :Spk.PackageDefinition = (
         verbPhrase = (defaultText = "removed from card"),
         verbPhrase = (defaultText = "removed from card"),
       ), ],
       ), ],
     ),
     ),
-    apiPath = "/api",
+    apiPath = "/",
     saveIdentityCaps = true,
     saveIdentityCaps = true,
   ),
   ),
 );
 );

+ 0 - 21
server/authentication.js

@@ -16,27 +16,6 @@ Meteor.startup(() => {
   Authentication = {};
   Authentication = {};
 
 
   Authentication.checkUserId = function (userId) {
   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) {
     if (userId === undefined) {
       const error = new Meteor.Error('Unauthorized', 'Unauthorized');
       const error = new Meteor.Error('Unauthorized', 'Unauthorized');
       error.statusCode = 401;
       error.statusCode = 401;