function isTokened(data) {
var token = data;
if(token != null || token != undefined){
jwt.verify(token, app.get('userToken'), function(err, decoded) {
return {
"user": decoded._doc.name,
"href": "/salir",
"text": "Salir"
};
});
}else{
return {
href: "/entrar",
text: "Entrar"
};
}
}
- はTypeError:C:ヘクター\デスクトップ\ PROYECTO \ビュー\ index.jade \ \ユーザー:81
79 |リ
a.text(HREF = '/ acerca')関数が何も返さずに出て終わるようAcerca81| if au.user 82| li 83| a.text(href="/area") #{au.user} 84|
li Cannot read property 'user' of undefined at eval (eval at
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:218:8), :354:8) at eval (eval at
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:218:8), :453:22) at exports.compile.res
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:219:38) at Object.exports.renderFile
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:380:38) at Object.exports.renderFile
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:370:21) at View.exports.__express [as engine]
(c:\Users\Hector\Desktop\Proyecto\node_modules\jade\lib\index.js:417:11) at View.render
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\view.js:126:8) at tryRender
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\application.js:639:10) at EventEmitter.render
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\application.js:591:3) at ServerResponse.render
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\response.js:961:7) at c:\Users\Hector\Desktop\Proyecto\app.js:167:6 at Layer.handle [as handle_request]
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\router\layer.js:95:5) at next
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\router\route.js:131:13) at Route.dispatch
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request]
(c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\router\layer.js:95:5) at
c:\Users\Hector\Desktop\Proyecto\node_modules\express\lib\router\index.js:277:22エラーの戻り値、Nodejs、JWT