refactor: standardize navigation behavior by applying replace: true to authentication and activation flows

This commit is contained in:
ramvignesh-b
2026-04-19 02:19:53 +05:30
parent 1c1b5ea14e
commit ec769818f5
4 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -68,7 +68,10 @@ export default function Activate() {
type="button" type="button"
className="btn btn-primary w-full shadow-lg" className="btn btn-primary w-full shadow-lg"
onClick={() => onClick={() =>
navigate(ROUTES.LOGIN, { state: { firstTime: true } }) navigate(ROUTES.LOGIN, {
state: { firstTime: true },
replace: true,
})
} }
> >
Start Writing Start Writing
+1 -1
View File
@@ -187,7 +187,7 @@ export default function Drawer() {
<button <button
type="button" type="button"
className="group mt-15 z-10 bg-transparent border border-dashed border-base-content/10 px-8 py-4 text-base-content/40 italic cursor-pointer transition-all hover:border-primary/40 hover:text-base-content/60 hover:bg-primary/5 hover:-translate-y-0.5 flex items-center gap-2 focus-visible:ring-2 focus-visible:ring-primary/50 duration-1000" className="group mt-15 z-10 bg-transparent border border-dashed border-base-content/10 px-8 py-4 text-base-content/40 italic cursor-pointer transition-all hover:border-primary/40 hover:text-base-content/60 hover:bg-primary/5 hover:-translate-y-0.5 flex items-center gap-2 focus-visible:ring-2 focus-visible:ring-primary/50 duration-1000"
onClick={() => navigate(PATHS.write(""), { replace: true })} onClick={() => navigate(PATHS.write(""))}
> >
<FeatherIcon <FeatherIcon
size={18} size={18}
+1 -1
View File
@@ -59,7 +59,7 @@ export default function Login() {
// store the auth related data // store the auth related data
await setAuthStore(authData.access, userData, masterKey); await setAuthStore(authData.access, userData, masterKey);
navigate(ROUTES.DRAWER); navigate(ROUTES.DRAWER, { replace: true });
} catch (err) { } catch (err) {
let message = let message =
"Sorry, we're experiencing technical issues.\nPlease try again later."; "Sorry, we're experiencing technical issues.\nPlease try again later.";
+1 -1
View File
@@ -55,7 +55,7 @@ export default function Register() {
email: data.email, email: data.email,
password: authHash, password: authHash,
}); });
navigate(ROUTES.VERIFY_EMAIL); navigate(ROUTES.VERIFY_EMAIL, { replace: true });
} catch (err) { } catch (err) {
let message = "Registration failed. Please try again."; let message = "Registration failed. Please try again.";
if (axios.isAxiosError(err)) { if (axios.isAxiosError(err)) {