Hi, After adding values for expose_headers to my C...
# support-questions-legacy
l
Hi, After adding values for expose_headers to my CORS Middleware (Python/fastApi), the login form (React) is not working anymore. After clicking login, the page refreshes but i am still on the auth page. After removing the expose_headers it works fine.
Copy code
python
api = CORSMiddleware(
    app=api,
    allow_origins=[
        "http://localhost:3000"
    ],
    allow_credentials=True,
    allow_methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
    allow_headers=["Content-Type", SUPERTOKENS_HEADER] + get_all_cors_headers(),
    expose_headers=[SUPERTOKENS_HEADER]
)
The value for SUPERTOKENS_HEADER is
x-st-cookie
but i am still using the default cookie implementaion at this time.
r
Hey! You also need to add other headers into that list that we want to expose to the frontend.
The value you gave overwrites the values that we set
We also want to expose “id-refresh-token” and “front-token”
l
Ahhh now it works, thanks
r
Cool!
5 Views