Sorcery.StoreAdapter.Ecto (sorcery v0.3.0)
This adapter requires the repo module to be passed in as args.
Here is an example PortalServer
defmodule Src.PortalServers.Postgres do
use GenServer
def init(_) do
state = %{} # You can still add whatever you want here
state = Sorcery.PortalServer.add_portal_server_state(state, %{
config_module: Src, # See below
store_adapter: Sorcery.StoreAdapter.Ecto,
args: %{
repo_module: MyApp.Repo
}
})
{:ok, state}
end
def handle_info({:sorcery, msg}, state) do
new_state = Sorcery.PortalServer.handle_info(msg, state)
{:noreply, new_state}
end
end