Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into DLVR-478-update-to-…
Browse files Browse the repository at this point in the history
…0.10.0
  • Loading branch information
te0retik committed Sep 21, 2021
2 parents fef9b12 + 9872934 commit 2e1d5b8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/ueberauth/strategy/google.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ defmodule Ueberauth.Strategy.Google do
end
end

@doc """
Handles the callback from app.
"""
def handle_callback!(%Plug.Conn{params: %{"id_token" => id_token}} = conn) do
client = Ueberauth.Strategy.Google.OAuth.client
case verify_token(conn, client, id_token) do
{:ok, user} ->
put_user(conn, user)
{:error, reason} ->
set_errors!(conn, [error("token", reason)])
end
end

@doc false
def handle_callback!(conn) do
set_errors!(conn, [error("missing_code", "No code received")])
Expand Down

0 comments on commit 2e1d5b8

Please sign in to comment.