Skip to content

Commit

Permalink
Fixed login with token without next parameter (cvat-ai#7999)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Jun 11, 2024
1 parent 5de8cc8 commit 3c46023
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- When use route `/auth/login-with-token/<token>` without `next` query parameter
the page reloads infinitely (<https://github.com/cvat-ai/cvat/pull/7999>)
8 changes: 2 additions & 6 deletions cvat-ui/src/components/login-with-token/login-with-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ export default function LoginWithTokenComponent(): JSX.Element {
useEffect(
() => {
localStorage.setItem('token', token);
const next = search.get('next');
if (next) {
(window as Window).location = next;
} else {
window.location.reload();
}
const next = search.get('next') ?? '/';
(window as Window).location = next;
},
[token],
);
Expand Down

0 comments on commit 3c46023

Please sign in to comment.