Skip to content

Commit 8e676a1

Browse files
fix(auth): persist Swagger UI authorization across page refreshes
Set persistAuthorization=True in swagger_ui_parameters so the Bearer token is stored in localStorage instead of JS memory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1c5e71c commit 8e676a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
124124

125125

126126
# main web app
127-
app = FastAPI(title="meetup_bot API", openapi_url="/meetup_bot.json", lifespan=lifespan)
127+
app = FastAPI(
128+
title="meetup_bot API",
129+
openapi_url="/meetup_bot.json",
130+
lifespan=lifespan,
131+
swagger_ui_parameters={"persistAuthorization": True},
132+
)
128133

129134
# add `/api` route in front of all other endpoints
130135
api_router = APIRouter(prefix="/api")

0 commit comments

Comments
 (0)