riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

Improve how the session is added in the remember module #81

Closed riverrun closed 6 years ago

riverrun commented 6 years ago

In the latest version (on the master branch), the set_user function is customized to add a session_id (uuid v4) to the session and also add this session_id to the current_user map. It might be better to allow the developer to add a custom function (to be called after set_user) which adds the session_id to the session and updates the user / session table in the database.

This custom function could also include logic to manage cookies, as outlined in #75.

Does anyone have any thoughts on this matter?

riverrun commented 6 years ago

In version 2.0.0-beta.1, added a requirement for the user_context to have a create_session function - which returns {:ok, session} or {:error, message}.