Closed imnash21 closed 1 week ago
I installed Laravel + InertiaJS yesterday (June 22, 2024).
The replace option in useForm hook not working properly.
"/" (Landing Page) <- This is my starting point.
"/login" (Login Page) <- My second point.
"/dashboard" (Dashboard Page) <- My third point, after the POST request.
In form:
const form = useForm(...)
const handleSubmit: React.FormEventHandler = (e) => { e.preventDefault()
form.post('/login', { replace: true, })
}
At the controller:
public function login(Request $request) { ........... ..... ........
return to_route('dashboard')
After redirected to dashboard page, then when I clicked the back button twice, it will go back to login page not to landing page.
I installed Laravel + InertiaJS yesterday (June 22, 2024).
The replace option in useForm hook not working properly.
"/" (Landing Page) <- This is my starting point.
"/login" (Login Page) <- My second point.
"/dashboard" (Dashboard Page) <- My third point, after the POST request.
In form:
const form = useForm(...)
const handleSubmit: React.FormEventHandler = (e) => { e.preventDefault()
}
At the controller:
public function login(Request $request) { ........... ..... ........
}
After redirected to dashboard page, then when I clicked the back button twice, it will go back to login page not to landing page.