Replies: 3 comments 4 replies
-
I just tested FastUI with FastAPI Users, and there were no issues. You are likely using CookieTransport. As long as you use the login API on the page, it will automatically update the cookie. After that, accessing the authorized API should work without any problems. |
Beta Was this translation helpful? Give feedback.
-
First of all, I get a Depend 401 when using it, but I need None or object. |
Beta Was this translation helpful? Give feedback.
-
If you receive a 401 error, it means you need to call the login API first. Returning to a specific page after logging in is something you must handle yourself—I don’t think it’s the responsibility of FastAPI Users. You should create a login page that calls the login API. If you receive a 204 response, then proceed with redirecting to your expected page. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to integrate FastUI with fastapi-users, but the login response always returns a 204 status, and I can't figure out how to modify the login response content or configure login_responses correctly.
Also, I need to get the user object or None using Depends:
current_active_user = fastapi_users.current_user(active=True, verified=True)
How can I achieve this?
Beta Was this translation helpful? Give feedback.
All reactions