ExPipedrivePhoenix.Install (ex_pipedrive_phoenix v0.1.0)

Copy Markdown View Source

Authorize-redirect and callback helpers for Pipedrive marketplace OAuth.

use ExPipedrivePhoenix.Install, opts defines authorize/2 and callback/2 on a Phoenix controller. See the package README for a router example.

Independent of Überauth — uses ExPipedrive.Oauth and TokenStore from core.

Summary

Functions

Puts a CSRF state in the session and redirects to Pipedrive authorize.

Exchanges code, persists the token, and redirects to :success_to.

Functions

authorize(conn, opts)

@spec authorize(
  Plug.Conn.t(),
  keyword()
) :: Plug.Conn.t()

Puts a CSRF state in the session and redirects to Pipedrive authorize.

callback(conn, params, opts)

@spec callback(Plug.Conn.t(), map(), keyword()) :: Plug.Conn.t()

Exchanges code, persists the token, and redirects to :success_to.