更新时间:2023-09-20 22:03:52
You haven't told Flask-Login what view to use to show the login form, so it defaults to a generic 401 error. From the docs: "If the login view is not set, it will abort with a 401 error."
login_manager.login_view = 'login'
在Asp.Net Core 2中使用JwtBearer身份验证时,返回401而不是重定向到登录页面
Flask-Login显示401而不是重定向到登录视图
使用API路由时,未经授权时返回Http响应401而不是重定向到登录页面