amisadmin / fastapi-amis-admin

FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.
http://docs.amis.work
Apache License 2.0
1.08k stars 159 forks source link

307 Temporary Redirect loop #144

Open lifengmds opened 11 months ago

lifengmds commented 11 months ago

默认代码安装,登陆root成功后, 307 Temporary Redirect死循环。日志如下:

2023-11-17 08:57:37,025 INFO sqlalchemy.engine.Engine [cached since 408.3s ago] (2,)
INFO:     15.204.16.79:9173 - "GET /auth/form/login?redirect=/admin/ HTTP/1.1" 307 Temporary Redirect
2023-11-17 08:57:37,037 INFO sqlalchemy.engine.Engine COMMIT
2023-11-17 08:57:37,507 INFO sqlalchemy.engine.Engine BEGIN (implicit)
2023-11-17 08:57:37,507 INFO sqlalchemy.engine.Engine SELECT auth_token.token, auth_token.create_time, auth_token.id, auth_token.data
FROM auth_token
WHERE auth_token.token = %s
2023-11-17 08:57:37,507 INFO sqlalchemy.engine.Engine [cached since 409.4s ago] ('_JDgGlV_etBtYw77BC5OhaoBaGlRYEXXe7FOIqCWdFM',)
INFO:     15.204.16.79:9173 - "GET / HTTP/1.1" 307 Temporary Redirect
2023-11-17 08:57:37,513 INFO sqlalchemy.engine.Engine COMMIT
2023-11-17 08:57:37,948 INFO sqlalchemy.engine.Engine BEGIN (implicit)
2023-11-17 08:57:37,948 INFO sqlalchemy.engine.Engine SELECT auth_token.token, auth_token.create_time, auth_token.id, auth_token.data
FROM auth_token
WHERE auth_token.token = %s
2023-11-17 08:57:37,949 INFO sqlalchemy.engine.Engine [cached since 409.9s ago] ('_JDgGlV_etBtYw77BC5OhaoBaGlRYEXXe7FOIqCWdFM',)
2023-11-17 08:57:37,955 INFO sqlalchemy.engine.Engine SELECT auth_user.email AS auth_user_email, auth_user.password AS auth_user_password, auth_user.username AS auth_user_username, auth_user.delete_time AS auth_user_delete_time, auth_user.update_time AS auth_user_update_time, auth_user.create_time AS auth_user_create_time, auth_user.id AS auth_user_id, auth_user.is_active AS auth_user_is_active, auth_user.nickname AS auth_user_nickname, auth_user.avatar AS auth_user_avatar
FROM auth_user
WHERE auth_user.id = %s
2023-11-17 08:57:37,955 INFO sqlalchemy.engine.Engine [cached since 409.3s ago] (2,)
INFO:     15.204.16.79:9173 - "GET /auth/form/login?redirect=/admin/ HTTP/1.1" 307 Temporary Redirect
cic1988 commented 10 months ago

这个错误困扰了我一阵。如果用root或者admin登录就没有问题。但是用新建用户就会这样。workaround是把这个用户权限调到可以查看user authentication这个页面,就不会有endless loop了

zeroChen00 commented 3 months ago

不管是初始化用户还是新建用户,都需要去root里面赋权,给个首页权限就不会重定向次数过多了