Tenex.Plug (Tenex v1.0.4)
View SourceThis module have some basic functions for our tenex plugs.
The plugs we have for now are:
Tenex.ParamPlug- loads the tenant from a body or query paramTenex.SessionPlug- loads the tenant from a session paramTenex.SubdomainPlug- loads the tenant from the url subdomainTenex.EnsurePlug- ensures the current tenant is loaded and halts if not
Summary
Functions
Ensure the tenant is loaded, and if not, halts the conn.
Puts the given tenant as an assign on the given conn, but only if the
tenant is not reserved.
Functions
Ensure the tenant is loaded, and if not, halts the conn.
The config map/struct must have:
assign: the name of the assign where we must save the tenant.
Puts the given tenant as an assign on the given conn, but only if the
tenant is not reserved.
The config map/struct must have:
tenant_handler: function to handle the tenant param. Its return will be used as the tenant.assign: the name of the assign where we must save the tenant.