Class ResetPasswordPost
java.lang.Object
io.github.sigmacasino.HTTPRoute
io.github.sigmacasino.PostRoute
io.github.sigmacasino.routes.account.ResetPasswordPost
- All Implemented Interfaces:
spark.Route
The ResetPasswordPost class handles the POST request for resetting a user's password.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.slf4j.Logger
The logger for the ResetPasswordPost class.Fields inherited from class io.github.sigmacasino.HTTPRoute
app, loginRequired, path
-
Constructor Summary
ConstructorsConstructorDescriptionResetPasswordPost
(App app) Constructs a ResetPasswordPost route with the specified application. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handlePost
(spark.Request request, spark.Response response) Handles the POST request to reset the user's password.Methods inherited from class io.github.sigmacasino.PostRoute
handle, parseBodyParams, registerSparkRoute
-
Field Details
-
logger
private org.slf4j.Logger loggerThe logger for the ResetPasswordPost class.
-
-
Constructor Details
-
ResetPasswordPost
Constructs a ResetPasswordPost route with the specified application.- Parameters:
app
- the application instance
-
-
Method Details
-
handlePost
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 classPostRoute
- Parameters:
request
- the HTTP requestresponse
- the HTTP response- Throws:
SQLException
- if an error occurs during password reset
-