MasoniteFramework / masonite

The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Discord channel for questions: https://discord.gg/TwKeFahmPZ

Home Page:http://docs.masoniteproject.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remember me password

ssestantech opened this issue · comments

Is your feature request related to a problem?

remember me password

What do we currently have to do now?

remember me password

Describe the solution you'd like

remember me password checkbox functionality. how will i implement on login page. any doc for this.

Describe alternatives you've considered

No response

Would this be a breaking change ?

  • Yes

Anything else ?

No response

@ssestantech

The simplest way is probably to use a cookie or session to store the user data (depending on the size of the data) during the Login (authentication) flow.
When seting the data define an expiry time for that data lifetime.

If the remember me is checked then a longer time is set until the session/cookie data expires
if not set a default which is defined in the config.session file as part of the driver options

The LoadUserMiddleware is a good place to start digging in to understand the logic as it is loaded (by default) after the SessionMiddleware.
This will show you how the these middlewares work together.

You can the customise your own LoadUserMiddleware if additional logic is necessary.

Hope this helps