summaryrefslogtreecommitdiffstats
path: root/server/authentication.js
diff options
context:
space:
mode:
authormayjs <johannes.may@udo.edu>2017-05-15 18:40:45 +0200
committermayjs <johannes.may@udo.edu>2017-05-15 18:40:45 +0200
commit609a8894ece85ab36dc5ef88db5f290484dce9ff (patch)
tree3f481f16d639cd5200200c4232690a2c44a8b12d /server/authentication.js
parentadc6a45185be52ae4d6d4796a07c36859a9fd464 (diff)
downloadwekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.tar.gz
wekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.tar.bz2
wekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.zip
Added a non restrictive authentication function
Diffstat (limited to 'server/authentication.js')
-rw-r--r--server/authentication.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/authentication.js b/server/authentication.js
index 816c4d4c..6fee8649 100644
--- a/server/authentication.js
+++ b/server/authentication.js
@@ -17,5 +17,15 @@ Meteor.startup(() => {
};
+ // This will only check if the user is logged in.
+ // The authorization checks for the user will have to be done inside each API endpoint
+ Authentication.checkLoggedIn = function(userId) {
+ if(userId === undefined) {
+ const error = new Meteor.Error('Unauthorized', 'Unauthorized');
+ error.statusCode = 401;
+ throw error;
+ }
+ };
+
});