我试图对一个用户进行身份验证,我可以创建一个用户并获得承载者,但是之后我添加了这个代码来进行身份验证,它每隔几秒钟就会显示以下错误一次:
UnauthorizedError: invalid algorithm
at /mnt/c/Projects/myProject/node_modules/express-jwt/lib/index.js:105:22
at /mnt/c/Projects/myProject/node_modules/jsonwebtoken/verify.js:121:14
at getSecret (/mnt/c/Projects/myProj
我已经有一个用Node Js和express构建的应用程序,也有一个使用redux的create-react-app的前端,但现在我想把它移到下一个Js,但我被卡住了,因为我没有正确的方式使用我的rest Full API进行身份验证和授权,我想说的是我的API已经使用JWT处理这个问题(保存在cookie中)
我刚刚尝试使用NodeJS的JWT-Express包,以便在用户想要登录时创建一个JWT令牌。不幸的是,我在包中收到了一个TypeError。
下面是我的代码:
var express = require('express');
var app = express();
var jwt = require('jwt-express');
app.use(jwt.init('secret'));
app.get('/login', function(req, res) {
var user = {
fir
我想实现请求身份验证,但是这个错误一直存在:
错误:传递给findByPk的参数无效: object at Function.findByPk、at Function.Model.findById (/home/admin/Desktop/project/node_modules/sequelize/lib/model.js:4209:25) at JwtStrategy.passport.use.JwtStrategy at /home/admin/Desktop/project/node_modules/passport-jwt/lib/strategy.js:123:34在/home
我有一个Vue 3应用程序和一个Apollo & Express服务器。当我想要与后端通信时,我会遇到这些问题(如下所示):
Morgan在终端显示的后端错误:
UnauthorizedError: Format is Authorization: Bearer [token]
at middleware (/Users/user/vscode/gestion-subvention-api/node_modules/express-jwt/lib/index.js:73:21)
at Layer.handle [as handle_request] (/Users/us
使用jwt-simple lib时,我得到以下错误:
TypeError: Cannot read property 'split' of undefined
at module.exports (C:\my_application\services\mylist.js:5:40)
at Layer.handle [as handle_request] (C:\my_application\node_modules\express\lib\router\layer.js:95:5)
at next (C:\my_application\node_modu