Tenex.SessionPlug (Tenex v1.0.4)

View Source

This is a basic plug that loads the current tenant assign from a given value set on session.

To plug it on your router, you can use:

plug Tenex.SessionPlug,
  session: :subdomain,
  tenant_handler: &TenantHelper.tenant_handler/1

See Tenex.SessionPlugConfig to check all the allowed config flags.