Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
and remove accidental comment
  • Loading branch information
ekzyis committed Dec 5, 2023
1 parent 3bd42f9 commit 8aef88e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/switch-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ export const AccountProvider = ({ children }) => {
}, [setAccounts])

const multiAuthSignout = useCallback(async () => {
// document.cookie = 'multi_auth.user-id='
// switch to next available account
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()
return status
}, [updateAccountsFromCookie])
Expand Down

0 comments on commit 8aef88e

Please sign in to comment.