Skip to content

Commit

Permalink
fix(admin-ui): Fix sign out in admin panel not redirecting correctly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
StephixOne authored Aug 23, 2023
1 parent 8b86041 commit 57e199e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/flat-walls-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/admin-ui": patch
"@medusajs/admin": patch
---

fix(admin-ui): Fix sign out in admin panel not redirecting correctly
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import SignOutIcon from "../../fundamentals/icons/log-out-icon"
const UserMenu: React.FC = () => {
const navigate = useNavigate()

const { user, isLoading } = useAdminGetSession()
const { user, isLoading, remove } = useAdminGetSession()
const { mutate } = useAdminDeleteSession()

const notification = useNotification()

const logOut = () => {
mutate(undefined, {
onSuccess: () => {
remove()
navigate("/login")
},
onError: (err) => {
Expand Down

0 comments on commit 57e199e

Please sign in to comment.