agungsugiarto / codeigniter4-authentication

The codeigniter4\authentication component provides an API for authentication and includes concrete authentication adapters for common use case scenarios.
MIT License
49 stars 9 forks source link

InvalidArgumentException when logging in #31

Closed luciocodeigniter closed 1 year ago

luciocodeigniter commented 1 year ago

I'm getting the error below when trying to login:

InvalidArgumentException Cache key contains reserved characters {}()/\@:

Below is an image of the error: Cache_key_contains_reserved_characters

Setting my environment:

AMBIENTE_ERRO_LOGIN

agungsugiarto commented 1 year ago

hello @luciocodeigniter can you share more detail input from browser?

this issue from this controller

https://github.com/agungsugiarto/codeigniter4-authentication/blob/212dc57ae8a710cb478fb508f9ccb74fc3879ccc/src/Controllers/Auth/AuthenticatedSessionController.php#L137-L140

luciocodeigniter commented 1 year ago

Thanks for the feedback!

Follow debug (dd) in the post and in the mentioned method: DEBUG_agungsugiarto

luciocodeigniter commented 1 year ago

Just to complement,

I found a similar case on the web and the solution followed as follows.

Note: I applied what is mentioned in the following link and it seems to me that it fixed it.

Anyway, I'd like to know your opinion:

How it turned out:

// see: https://bytemeta.vip/repo/lonnieezell/myth-auth/issues/378
         return strtolower(Str::extractName($this->request->getPost('email'))) . '_' . str_replace("::", "", md5($this->request->getIPAddress()));
agungsugiarto commented 1 year ago

Fix in pr https://github.com/agungsugiarto/codeigniter4-authentication/pull/35