File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,7 @@ public function forcePasswordReset(): void
3535 return ;
3636 }
3737
38- // Set force_reset to true
39- $ identityModel = model (UserIdentityModel::class);
40- $ identityModel ->set ('force_reset ' , 1 );
41- $ identityModel ->where (['user_id ' => $ this ->id , 'type ' => Session::ID_TYPE_EMAIL_PASSWORD ]);
42- $ identityModel ->update ();
38+ $ this ->setForceReset (true );
4339 }
4440
4541 /**
@@ -52,9 +48,18 @@ public function undoForcePasswordReset(): void
5248 return ;
5349 }
5450
55- // Set force_reset to false
51+ $ this ->setForceReset (false );
52+ }
53+
54+ /**
55+ * Set force_reset
56+ */
57+ private function setForceReset (bool $ value ): void
58+ {
59+ $ value = (int ) $ value ;
60+
5661 $ identityModel = model (UserIdentityModel::class);
57- $ identityModel ->set ('force_reset ' , 0 );
62+ $ identityModel ->set ('force_reset ' , $ value );
5863 $ identityModel ->where (['user_id ' => $ this ->id , 'type ' => Session::ID_TYPE_EMAIL_PASSWORD ]);
5964 $ identityModel ->update ();
6065 }
You can’t perform that action at this time.
0 commit comments