Amur.Callback behaviour (amur v0.3.4)

Copy Markdown

Behaviour for handling the result of an OAuth flow.

Implement both callbacks in the module configured by :on_success and :on_failure. The success callback receives the normalized user and OAuth token, while the failure callback receives the reason the flow failed.

Summary

Types

context()

@type context() :: %{:user => Amur.User.t(), optional(atom()) => term()}

Callbacks

on_failure(t, term)

@callback on_failure(Plug.Conn.t(), term()) :: Plug.Conn.t()

on_success(t, context)

@callback on_success(Plug.Conn.t(), context()) :: Plug.Conn.t()