Skip to content

Instantly share code, notes, and snippets.

@iancharters
Created April 19, 2019 06:09
Show Gist options
  • Save iancharters/3a515d425407f2ebeab2782e2fba22f3 to your computer and use it in GitHub Desktop.
Save iancharters/3a515d425407f2ebeab2782e2fba22f3 to your computer and use it in GitHub Desktop.
defmodule ApiWeb.TestController do
use ApiWeb, :controller
alias Api.OAuth.Github
alias ApiWeb.View.TestView
# action_fallback(ApiWeb.FallbackController)
def callback(conn, %{"code" => code, "state" => _state}) do
response = Github.get_token(code)
IO.inspect(response)
conn
|> put_status(200)
|> put_view(TestView)
|> render("success.json", params: %{})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment