mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
Add change password functionality for users
Introduces a change password route, form, and template, allowing authenticated users to update their password. Updates the User model with a method to set the must_change_password flag. Adjusts login and navigation logic to support the new flow and ensures users are redirected to change their password if required.
This commit is contained in:
@@ -6,7 +6,7 @@ from typing import Optional
|
||||
def login_required():
|
||||
if not current_user.is_authenticated:
|
||||
return redirect(url_for("auth.login"))
|
||||
# if current_user.must_change_password:
|
||||
if current_user.must_change_password:
|
||||
flash("You have to change your password")
|
||||
return redirect(url_for("auth.change_password"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user