lonnieezell / myth-auth

One-stop Auth package for CodeIgniter 4
MIT License
637 stars 208 forks source link

An error occurred in the forgot password feature #528

Closed akbards closed 2 years ago

akbards commented 2 years ago

I want to thank you because this library helped a lot in my project using CodeIgniter 4. But i got an error message when i try forgot password feature. I got the following error message:

ErrorException strtolower(): Passing null to parameter #1 ($string) of type string is deprecated VENDORPATH\myth\auth\src\Authentication\Passwords\NothingPersonalValidator.php at line 71

Everything went well until getting token via email, when i submit for new password, i get the error.

error_message

manageruz commented 2 years ago

Hello akbards What is your codeigniter 4 version and what is your myth/auth version?

manageruz commented 2 years ago

It would be great to know your php version too

manageruz commented 2 years ago

Try to update to the latest version of CI and myth auth.

DwiNovianto11 commented 2 years ago

$rules = [ 'token' => 'required', 'email' => 'required|valid_emails', 'password' => 'required', 'pass_confirm' => 'required|matches[password]', ]; strong password delete in your AuthController.php

erikkraijenoord commented 2 years ago

Guessing you currently use PHP 8.1.x ?

A quick work around would be to add this package to your ThirdParty folder and modify the line to

$userName = \strtolower( $user->username ?? "" );
$email    = \strtolower( $user->email ?? "" );
akbards commented 2 years ago

thank you all for the response. @DwiNovianto11 suggestion solved my problem, although it removed the strong password validation. But, it's ok for me now. Thank you

and sorry if my english is not good, because i don't understand it well