Add comment

and remove accidental comment
This commit is contained in:
ekzyis 2023-12-05 05:55:39 +01:00
parent 9aeeae99d1
commit 175124bcc5
1 changed files with 3 additions and 1 deletions

View File

@ -41,9 +41,11 @@ export const AccountProvider = ({ children }) => {
}, [setAccounts]) }, [setAccounts])
const multiAuthSignout = useCallback(async () => { const multiAuthSignout = useCallback(async () => {
// document.cookie = 'multi_auth.user-id='
// switch to next available account // switch to next available account
const { status } = await fetch('/api/signout', { credentials: 'include' }) const { status } = await fetch('/api/signout', { credentials: 'include' })
// if status is 201, this mean the server was able to switch us to the next available account
// and the current account was simply removed from the list of available accounts including the corresponding JWT.
// -> update needed to sync state with cookies
if (status === 201) updateAccountsFromCookie() if (status === 201) updateAccountsFromCookie()
return status return status
}, [updateAccountsFromCookie]) }, [updateAccountsFromCookie])