Behaviour for exporting user data.
Sigra provides a default implementation that exports auth-related data (user profile, sessions, OAuth identities). Application developers implement this behaviour to add app-specific data.
Usage
defmodule MyApp.DataExport do
@behaviour Sigra.DataExport
@impl true
def export_user_data(user) do
{:ok, %{
profile: %{name: user.name, bio: user.bio},
posts: MyApp.Posts.list_by_user(user.id)
}}
end
end
Summary
Callbacks
Export all data associated with the given user.
Functions
Exports Sigra's own auth data for a user.
Callbacks
Functions
Exports Sigra's own auth data for a user.
Returns a map with keys: :user, :sessions, :identities.
This is always included in exports regardless of the app's implementation.
Options
:session_schema- The generated UserSession Ecto schema module.:identity_schema- The generated UserIdentity Ecto schema module.