Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 894f5bde authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Change callback to only verify id_token

parent c5a0f25e
Branches
No related tags found
No related merge requests found
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment