Skip to content

Commit 3d5ef06

Browse files
himdelpatchback[bot]
authored andcommitted
logout: reload user info after logout, instead of assuming null (#4383)
because the UI doesn't really know about the anonymous user, except from the API so.. logout would set user to null, going through the codepath that redirects to /login, which would go to github and log in again instead, reloading the info when in anonymous mode, the user gets set to the anonymous user, with no redirects Issue: AAH-2726 (cherry picked from commit ceba5a3)
1 parent 074390f commit 3d5ef06

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES/2726.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
logout: reload user info after logout, instead of assuming null

src/loaders/standalone/layout.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ export const StandaloneLayout = ({
7777
<DropdownItem
7878
key='logout'
7979
aria-label={'logout'}
80-
onClick={() => ActiveUserAPI.logout().then(() => setUser(null))}
80+
onClick={() =>
81+
ActiveUserAPI.logout()
82+
.then(() => ActiveUserAPI.getUser().catch(() => null))
83+
.then((user) => setUser(user))
84+
}
8185
>
8286
{t`Logout`}
8387
</DropdownItem>,

0 commit comments

Comments
 (0)