aboutsummaryrefslogtreecommitdiff
path: root/src/operations/reset_password.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/operations/reset_password.cr')
-rw-r--r--src/operations/reset_password.cr11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/operations/reset_password.cr b/src/operations/reset_password.cr
new file mode 100644
index 0000000..3bdd3c8
--- /dev/null
+++ b/src/operations/reset_password.cr
@@ -0,0 +1,11 @@
+class ResetPassword < User::SaveOperation
+ # Change password validations in src/operations/mixins/password_validations.cr
+ include PasswordValidations
+
+ attribute password : String
+ attribute password_confirmation : String
+
+ before_save do
+ Authentic.copy_and_encrypt password, to: encrypted_password
+ end
+end