mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:01:09 +02:00
🐛 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:
parent
8dd1e4326c
commit
08057138a6
1 changed files with 2 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue