Haytni.TrackablePlugin (Haytni v0.7.0) View Source

This module keeps tracks of the following elements:

  • the remote address IP used by the client at each of its sign in (in a table apart)
  • when he lastly signed in

To do so a new module will be dynamically created by suffixing "Connection" to the module of your user's schema (eg: YourApp.User => YourApp.UserConnection)

Fields:

  • last_sign_in_at (datetime@utc, nullable, default: NULL): date/time when the current session was started, nil if the user has never signed in
  • current_sign_in_at (datetime@utc, nullable, default: NULL): date/time when the previous session was started, nil if the user has never signed in at least twice

Note that the previous fields can be nil, don't forget to handle this specific case!

Configuration: none

Routes: none

Link to this section Summary

Link to this section Functions

Callback implementation for Haytni.Plugin.build_config/1.

Link to this function

find_user(conn, module, config)

View Source

Callback implementation for Haytni.Plugin.find_user/3.

Link to this function

invalid?(user, module, config)

View Source

Callback implementation for Haytni.Plugin.invalid?/3.

Link to this function

on_delete_user(multi, user, module, config)

View Source

Callback implementation for Haytni.Plugin.on_delete_user/4.

Link to this function

on_email_change(multi, changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.on_email_change/4.

Link to this function

on_failed_authentication(user, multi, keywords, module, config)

View Source

Callback implementation for Haytni.Plugin.on_failed_authentication/5.

Link to this function

on_logout(conn, module, config)

View Source

Callback implementation for Haytni.Plugin.on_logout/3.

Link to this function

on_registration(multi, module, config)

View Source

Callback implementation for Haytni.Plugin.on_registration/3.

Link to this function

routes(config, prefix_name, options)

View Source

Callback implementation for Haytni.Plugin.routes/3.

Link to this function

validate_create_registration(changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.validate_create_registration/3.

Link to this function

validate_password(changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.validate_password/3.

Link to this function

validate_update_registration(changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.validate_update_registration/3.