BtrzAuth v1.2.0 BtrzAuth.Plug.VerifyPremium View Source
Looks for and validates that the passed keys
features are present in the account data under conn.private.account["premium"]
saved by BtrzAuth.Plug.VerifyApiKey
(the order of the plugs is very important!)
If the premium keys are not found under conn.private.account
, the pipeline will be halted and the conn.resp_body
with:
%{
"error" => "unauthorized",
"reason" => "premium_not_verified"
}
Options:
keys
- list of atom premium features to verify. Defaults to:[]
Example
plug BtrzAuth.Plug.VerifyPremium, keys: [:special_content]
Link to this section Summary
Link to this section Functions
Link to this function
call(conn, opts)
View Sourcecall(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()