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:
User A is logged in, welcome screen is correct (Hi, A 👋🏼)
User A logs off
User B logs in, welcome screen is wrongly still showing A's welcome screen (Hi, A 👋🏼)
Refresh the page, and welcome screen is showing correctly (Hi, B 👋🏼)
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: