Open Closed

Login | Forgot Password | When users click on the Browser back, they see resubmission page #9944


User avatar
0
dhill created

When users click on the browser back button from the forgot password page, they see the resubmission page Image

However, when they click on the Login button, they get navigated back to the main login page


1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    When users see a "Confirm Form Resubmission" page after clicking the browser back button from the forgot password page, it is due to the browser trying to re-execute a POST request. This is a standard browser behavior when navigating back to a page that was the result of a form submission (POST).

    To avoid this, you should implement the Post/Redirect/Get (PRG) pattern in your ABP login and forgot password flows. After processing a POST request (such as submitting the forgot password form), redirect the user to a GET page (such as a confirmation or the login page). This way, if the user navigates back, the browser will only re-request the GET page, not the POST, and the resubmission warning will not appear.

    Example for Razor Pages:

    public async Task<IActionResult> OnPostAsync()
    {
        if (!ModelState.IsValid)
        {
            return Page();
        }
    
        // Process forgot password logic here
    
        // Redirect to a confirmation page (GET)
        return RedirectToPage("./ForgotPasswordConfirmation");
    }
    

    This approach ensures that after a POST, the user is always redirected to a GET, preventing form resubmission issues.

    Sources:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 23, 2025, 10:47