PowAssent v0.3.2 PowAssent.Strategy behaviour View Source
Used for creating strategies.
Usage
Set up my_strategy.ex
the following way:
defmodule MyStrategy do
@behaviour PowAssent.Strategy
def authorize_url(config) do
# Generate redirect URL
{:ok, url, []}
end
def callback(config, params) do
# Fetch user data
{:ok, user, []}
end
end
Link to this section Summary
Functions
Decode a JSON response to a map
Decodes a request response
Recursively prunes map for nil values
Makes a HTTP request
Generates a URL
Link to this section Functions
Link to this function
decode_json!(response, config) View Source
Decode a JSON response to a map
Link to this function
decode_response(any, config) View Source
Decodes a request response.
Link to this function
prune(map) View Source
Recursively prunes map for nil values.
Link to this function
request(method, url, body, headers, config) View Source
Makes a HTTP request.
Link to this function
to_url(site, uri, params \\ []) View Source
Generates a URL
Link to this section Callbacks
Link to this callback
authorize_url(arg0) View Source
Link to this callback