Allows multiple messages
So far Devise models are using method overloading, or monkey-patching in order to provide the right flash message to be shown to the user informing about the authentication failure reason.
While this work fine, it's hard to understand and to debug (like in which order are executed the functions?), plus it prevent one little case to work : when you're reaching the lockable last_attempt, before your account is locked, you only see one flash message while there should be actually two.
All that was fine and nice until we added our own model (with a hook) to add exponential delay between login failures (quite common security request) showing a flash message with the delay to be waited before retrying a login attempt and being at the lockable last_attempt step : a flash message was missing.
This PR update Devise so that:
- it uses the future feature of warden to manage multiple messages
- it adapts Models to push messages to the
Models.devise_messagesarray - it passes the
Models.devise_messagesthe wardenfail!method - it adapts test suite to expect messages instead of message
- it propose a
Earthfileto easily run test suite on any platform
To be done
- [ ] open discussion about this change (Devise team feedback about this change, earthly, would you like some deprecation warnings,..?)
- [ ] discuss Earthly usage locally and/or from Github actions
- [ ] adapt the
inactive_messagecase in order to push message toModels.devise_messagesinstead - [ ] review the lockable test which still assert on the
unauthenticated_messagemethod - [x] increase Earthfile
VERSION