diff options
author | mayjs <johannes.may@udo.edu> | 2017-05-15 18:40:45 +0200 |
---|---|---|
committer | mayjs <johannes.may@udo.edu> | 2017-05-15 18:40:45 +0200 |
commit | 609a8894ece85ab36dc5ef88db5f290484dce9ff (patch) | |
tree | 3f481f16d639cd5200200c4232690a2c44a8b12d | |
parent | adc6a45185be52ae4d6d4796a07c36859a9fd464 (diff) | |
download | wekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.tar.gz wekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.tar.bz2 wekan-609a8894ece85ab36dc5ef88db5f290484dce9ff.zip |
Added a non restrictive authentication function
-rw-r--r-- | server/authentication.js | 10 |
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; + } + }; + }); |