tiangolo / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
MIT License
24.44k stars 4.12k forks source link

🐛 Fix welcome page to show logged-in user #1218

Closed tomerb closed 1 month ago

tomerb commented 1 month ago

Use up-to-date logged-in user value from useAuth, instead of stale query data. useAuth correctly refreshes, and holds the up-to-date value of the currently logged-in user.

This is fixing the following issue:

  1. User A is logged in, welcome screen is correct (Hi, A 👋🏼)
  2. User A logs off
  3. User B logs in, welcome screen is wrongly still showing A's welcome screen (Hi, A 👋🏼)
  4. Refresh the page, and welcome screen is showing correctly (Hi, B 👋🏼)
alejsdev commented 1 month ago

Great, thank you! :partying_face: @tomerb