Class ResetPasswordPost

java.lang.Object
io.github.sigmacasino.HTTPRoute
io.github.sigmacasino.PostRoute
io.github.sigmacasino.routes.account.ResetPasswordPost
All Implemented Interfaces:
spark.Route

public class ResetPasswordPost extends PostRoute
The ResetPasswordPost class handles the POST request for resetting a user's password.
  • Field Details

    • logger

      private org.slf4j.Logger logger
      The logger for the ResetPasswordPost class.
  • Constructor Details

    • ResetPasswordPost

      public ResetPasswordPost(App app)
      Constructs a ResetPasswordPost route with the specified application.
      Parameters:
      app - the application instance
  • Method Details

    • handlePost

      public void handlePost(spark.Request request, spark.Response response) throws SQLException
      Handles the POST request to reset the user's password. If the user is not logged in, they are redirected to the login page. If the old password is incorrect, the user is redirected to the reset password page with an error message. Otherwise, the user's password is updated and they are redirected to the account page.
      Specified by:
      handlePost in class PostRoute
      Parameters:
      request - the HTTP request
      response - the HTTP response
      Throws:
      SQLException - if an error occurs during password reset