Skip to content

Commit

Permalink
fix: login repeat 2 times (#2179)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 authored Oct 20, 2021
1 parent 0fc4be7 commit a6fc49b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions web/src/pages/User/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ const Page: React.FC = () => {
description: response.message,
duration: 1,
onClose: () => {
const redirect = getUrlQuery('redirect');
history.replace(redirect ? decodeURIComponent(redirect) : '/');
let redirect = getUrlQuery('redirect');
if (redirect) {
redirect = decodeURIComponent(redirect);
if (redirect === '/user/logout') {
redirect = '/';
}
} else {
redirect = '/';
}
history.replace(redirect);
},
});
}
Expand Down

0 comments on commit a6fc49b

Please sign in to comment.