diff --git a/src/components/AuthenticationFlow/EmailLoginForm.tsx b/src/components/AuthenticationFlow/EmailLoginForm.tsx index 6a3917806..e1ae7f15b 100644 --- a/src/components/AuthenticationFlow/EmailLoginForm.tsx +++ b/src/components/AuthenticationFlow/EmailLoginForm.tsx @@ -3,7 +3,7 @@ import type { FunctionComponent } from 'preact'; import { useState } from 'preact/hooks'; import { TOKEN_COOKIE_NAME } from '../../lib/constants'; import Spinner from '../Spinner'; -import {httpPost} from "../../lib/http"; +import { httpPost } from '../../lib/http'; const EmailLoginForm: FunctionComponent<{}> = () => { const [email, setEmail] = useState(''); @@ -46,7 +46,10 @@ const EmailLoginForm: FunctionComponent<{}> = () => { // If the response is ok, we'll set the token in a cookie Cookies.set(TOKEN_COOKIE_NAME, data.token); - window.location.href = '/'; + // Refreshing will automatically redirect to the relevant page + // Doing this to avoid redirecting to home page from any pages + // such as roadmap, best-practice etc + window.location.reload(); }) .catch((err) => { setIsLoading(false);