dwyl / dwyl/elixir-auth-google

Does this work with barebones Elixir / no Phoenix?

Open
#123 2 comments 2 reactions 0 assignees View on GitHub
help wanted question technical user-feedback
Dominant language
Elixir
Stars
290
Forks
46
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use this in a project without Phoenix and, with the same exact credentials, it will work on the Phoenix project but not on the Elixir one. It keeps throwing the "invalid_client" and "The OAuth client was not found." error after I request the token. I am running the server and client separately.

Here's the code:

```
post "/" do
conn = Plug.Conn.fetch_session(conn)

code = Map.get(conn.body_params, "code", "")

{:ok, token} =
ElixirAuthGoogle.get_token(
code,
"#{Application.get_env(:root, :frontend_url)}"
)
|> IO.inspect()

{:ok, profile} = ElixirAuthGoogle.get_user_profile(token.access_token) |> IO.inspect()

...
end
```

Am I doing something wrong? This is the only relevant code to the project, and it is throwing after ElixirAuthGoogle.get_token/2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.