![]() |
Hi,
In my project i've started writing a change password functionality for the users, this is checked by confirming the current password. Reading through the documentation i'm unable to find what method/helper I can use to run the current password check against the user. Using the login example does not work, it throws an exception about the session already being active, so i have no clue what to use at this point. Can someone push me in the right direction? EDIT: Did not look at all possible options, you can use the check() method to do that. See: https://codeigniter4.github.io/shield/au...uth-helper
Another way is to use magic-link. In this method, the user uses magic-link to login and after logging in, it is checked that it is done by logging in through magic-link and it is used to change the password.
It is possible to use session or events in this method.(magicLogin) https://codeigniter4.github.io/shield/qu...ink-logins
Thank you for the suggestion, but the check actually does everything i've needed for this part.
I've written a custom validation rules 'old_password' that will check the current password for the user. If anyone is interested on how this is done: PHP Code: public function old_password(string $password, ?string &$error = null): bool |
Welcome Guest, Not a member yet? Register Sign In |