riverrun/phauxth

Improve how the session is added in the remember module

Closed this issue · 1 comments

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?

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}.