尝试创建sailsjs策略失败,钩子“userconfig”错误

时间:2015-06-29 02:45:55

标签: sails.js policy

我无法在sailsjs中获得政策。

我一遍又一遍地在同一个地方

最简单的

1)我发布了新的testProject 2)我在config下添加文件夹策略 3)我在文件夹下添加了isAuthenticated.js

A hook (`userconfig`) failed to load!

sails lift --verbose

info: Starting app...

verbose: Setting Node environment...

verbose: Please run `npm install coffee-script` to use coffescript (skipping for now)

verbose: moduleloader hook loaded successfully.

verbose: Loading app config...

error: A hook (`userconfig`) failed to load!

verbose: Lowering sails...

verbose: Shutting down socket server...

verbose: Shutting down HTTP server...

error: Error: Invalid module:function isAuthenticated(req, res, next) {
   if (req.isAuthenticated()) {
     return next();
   }
   else{
     return res.redirect('/login');
   }
 }

0 个答案:

没有答案