appleboy / sails-auth-ldap-example

Example SailsJS application with ldap authentication.
MIT License
5 stars 2 forks source link

Cannot read property 'is_loggin' of undefined #53

Open victorjeman opened 8 years ago

victorjeman commented 8 years ago

Hi, I'm trying to run the project but form some reason I have the "Cannot read property 'is_loggin' of undefined" error. The app is still up to date ?

appleboy commented 8 years ago

Please provide the detail logs?

victorjeman commented 8 years ago

screen shot 2016-10-14 at 18 53 44

`error: Sending 500 ("Server Error") response: TypeError: /Users/victorjeman/WorkProjects/sails-auth-ldap-example/views/homepage.ejs:1

1| <% if (req.session.is_loggin) { %> 2|

申請測量

3| <% } else { %> 4|

登入系統

Cannot read property 'is_loggin' of undefined at eval (eval at (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:237:14), :30:48) at eval (eval at (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:237:14), :30:634) at /Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:250:15 at Object.exports.render (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:288:13) at Object.exports.renderFile (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:318:20) at SailsView.module.exports as engine at SailsView.View.render (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/view.js:76:8) at Function.app.render (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/application.js:561:10) at ServerResponse.res.render (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/response.js:845:7) at ServerResponse.res.view (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/sails/lib/hooks/views/res.view.js:284:16) at Object.module.exports.index (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/api/controllers/WelcomeController.js:28:16) at wrapper (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/lodash/index.js:3095:19) at routeTargetFnWrapper (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/sails/lib/router/bind.js:181:5) at callbacks (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:164:37) at param (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:138:11) at pass (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:145:5) at nextRoute (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:100:7) at callbacks (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:167:11) at alwaysAllow (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/sails/lib/hooks/policies/index.js:224:11) at routeTargetFnWrapper (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/sails/lib/router/bind.js:181:5) at callbacks (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:164:37) at param (/Users/victorjeman/WorkProjects/sails-auth-ldap-example/node_modules/express/lib/router/index.js:138:11)`

mahesh-msk commented 7 years ago

hi i'm also getting same error message please help me out.

mahesh-msk commented 7 years ago

{ "stack": "TypeError: D:\Projects\sails-auth-ldap-example-master\views\homepage.ejs:1\n >> 1| <% if (req.session.is_loggin) { %>\n 2| <p style=\"text-align: center\"><a class=\"btn btn-primary btn-lg\" href=\"/register\" role=\"button\">Apply

\n 3| <% } else { %>\n 4| <p style=\"text-align: center\"><a class=\"btn btn-primary btn-lg\" href=\"/login\" role=\"button\">Login

\n\nCannot read property 'is_loggin' of undefined\n at eval (eval at (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\ejs-locals\node_modules\ejs\lib\ejs.js:237:14), :30:48)\n at eval (eval at (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\ejs-locals\node_modules\ejs\lib\ejs.js:237:14), :30:636)\n at D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\ejs-locals\node_modules\ejs\lib\ejs.js:250:15\n at Object.exports.render (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\ejs-locals\node_modules\ejs\lib\ejs.js:288:13)\n at Object.exports.renderFile (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\ejs-locals\node_modules\ejs\lib\ejs.js:318:20)\n at SailsView.module.exports as engine\n at SailsView.View.render (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\view.js:76:8)\n at Function.app.render (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\application.js:561:10)\n at ServerResponse.res.render (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\response.js:845:7)\n at ServerResponse.res.view (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\lib\hooks\views\res.view.js:284:16)\n at Object.module.exports.index (D:\Projects\sails-auth-ldap-example-master\api\controllers\WelcomeController.js:36:16)\n at wrapper (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\lodash\index.js:3095:19)\n at routeTargetFnWrapper (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\lib\router\bind.js:181:5)\n at callbacks (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:164:37)\n at param (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:138:11)\n at pass (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:145:5)\n at nextRoute (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:100:7)\n at callbacks (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:167:11)\n at alwaysAllow (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\lib\hooks\policies\index.js:224:11)\n at routeTargetFnWrapper (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\lib\router\bind.js:181:5)\n at callbacks (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:164:37)\n at param (D:\Projects\sails-auth-ldap-example-master\node_modules\sails\node_modules\express\lib\router\index.js:138:11)", "message": "D:\Projects\sails-auth-ldap-example-master\views\homepage.ejs:1\n >> 1| <% if (req.session.is_loggin) { %>\n 2| <p style=\"text-align: center\"><a class=\"btn btn-primary btn-lg\" href=\"/register\" role=\"button\">Apply

\n 3| <% } else { %>\n 4| <p style=\"text-align: center\"><a class=\"btn btn-primary btn-lg\" href=\"/login\" role=\"button\">Login

\n\nCannot read property 'is_loggin' of undefined", "path": "D:\Projects\sails-auth-ldap-example-master\views\homepage.ejs"