Skip to content

Commit ceba5a3

Browse files
authored
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
1 parent fd12f91 commit ceba5a3

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
@@ -75,7 +75,11 @@ export const StandaloneLayout = ({
7575
<DropdownItem
7676
key='logout'
7777
aria-label={'logout'}
78-
onClick={() => ActiveUserAPI.logout().then(() => setUser(null))}
78+
onClick={() =>
79+
ActiveUserAPI.logout()
80+
.then(() => ActiveUserAPI.getUser().catch(() => null))
81+
.then((user) => setUser(user))
82+
}
7983
>
8084
{t`Logout`}
8185
</DropdownItem>,

0 commit comments

Comments
 (0)