🐛 fix(chat): use correct token storage key from shared-auth

Match localStorage key '@auth/appToken' used by @manacore/shared-auth
This commit is contained in:
Wuesteon 2025-12-01 15:19:09 +01:00
parent 8dd1e4326c
commit 08057138a6

View file

@ -23,9 +23,10 @@ async function fetchApi<T>(
const { method = 'GET', body, token } = options;
// Get token from localStorage if not provided
// Note: @manacore/shared-auth stores token as '@auth/appToken'
let authToken = token;
if (!authToken && browser) {
authToken = localStorage.getItem('mana_token') || undefined;
authToken = localStorage.getItem('@auth/appToken') || undefined;
}
if (!authToken) {