Fakultas Ilmu Komputer UI

Commit 894f5bde authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Change callback to only verify id_token

parent c5a0f25e
......@@ -58,9 +58,9 @@ defmodule DiskuyWeb.UserController do
# end
# end
def callback(conn, %{"code" => code}) do
with {:ok, token} = GoogleAuth.get_access_token(code, conn),
{:ok, user, new_token}= GoogleAuth.create_local_token(token) do
def callback(conn, _params) do
token = Guardian.Plug.current_token(conn)
with {:ok, user, new_token}= GoogleAuth.create_local_token(token) do
conn
|> put_status(:created)
|> render("user_token.json", %{user: user, token: new_token})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment