jonra1993 / fastapi-alembic-sqlmodel-async

This is a project template which uses FastAPI, Pydantic 2.0, Alembic and async SQLModel as ORM. It shows a complete async CRUD using authentication and role base access control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pass token for protected routes in Swagger?

nemanjam opened this issue · comments

First I logged in with /api/v1/login, but then browser doesn't pass Bearer token to the /api/v1/user/list and in UI there is no input field to pass it manually. How is this supposed to work? I can use curl, but UI should work too.

image

Hello @nemanjam. It does not work in such a way. To be able to use swagger you need to log in pressing the authorize button
image

or pressing the lock icon in protected endpoints

image

Thank you.