Skip to content

Commit

Permalink
define github_auth_controller.ex #29
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Nov 5, 2023
1 parent 31d39d7 commit 420a2b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/app_web/controllers/github_auth_controller.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule AppWeb.GithubAuthController do
use AppWeb, :controller

@doc """
`index/2` handles the callback from GitHub Auth API redirect.
"""
def index(conn, %{"code" => code}) do
{:ok, profile} = ElixirAuthGithub.github_auth(code)
render(conn, :welcome, [layout: false, profile: profile])
end
end

0 comments on commit 420a2b5

Please sign in to comment.