Skip to content

Commit

Permalink
fix: redirect to workspaces on login
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkothari22 committed Dec 17, 2024
1 parent 20a5b44 commit 475a270
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const Component = () => {
return login({ username: values.email, password: values.password }).then(() => {
//Reload the page so that the boot info is fetched again
const URL = import.meta.env.VITE_BASE_NAME ? `/${import.meta.env.VITE_BASE_NAME}` : ``
window.location.replace(`${URL}/channel`)
window.location.replace(`${URL}`)
}).catch((error) => { setError(error) })
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/auth/TwoFactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const TwoFactor = ({ loginWithTwoFAResponse, setError, setIsTwoFactorEnab
return login(credentials).then((res) => {
//Reload the page so that the boot info is fetched again
const URL = import.meta.env.VITE_BASE_NAME ? `/${import.meta.env.VITE_BASE_NAME}` : ``
window.location.replace(`${URL}/channel`)
window.location.replace(`${URL}`)
}).catch((error) => setError(error))
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/auth/UserProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const UserProvider: FC<PropsWithChildren> = ({ children }) => {

const handleLogout = async () => {
localStorage.removeItem('ravenLastChannel')
localStorage.removeItem('ravenLastWorkspace')
localStorage.removeItem('app-cache')
return logout()
.then(() => {
Expand Down

0 comments on commit 475a270

Please sign in to comment.