View Source Zoth.OpenId.Claim (Zoth v1.0.1)
Link to this section Summary
Functions
Return the value from the given source that is represented by the given claim.
Link to this section Types
@type standard_claim() :: :email | :email_verified
@type t() :: %Zoth.OpenId.Claim{ alias: atom(), includes: [t()], name: standard_claim(), transformer: function() | nil, value_when_missing: any() }
Link to this section Functions
Return the value from the given source that is represented by the given claim.
options
Options
:alias- When you want to return a value from the source that's named differentlythan the claim you can specify it's name (alias). For example perhaps the source has more than one email and you want to return `work_email` as the value for `email`. Alias is ignored when `:transformer` is given.:transformer- When passed a function it is executed with the givensourceand the result of the function is used as the value for the claim. You can specify a transformer when you wish to mutate a value into something else or use a derived value.:value_when_missing- Default isnil. You can specify a value to use when the`source` does not have the specified attribute. This value is ignored if you specify `:transformer`.