0

The page I am redirected to:

the page I am redirected to

The link looks like this:

https://github.com/login/oauth/authorize?client_id=&redirect_uri=http%3A%2F%2Flocalhost%3A4000%2Fauth%2Fgithub%2Fcallback&response_type=code&scope=user%2Cpublic_repo

Output from my terminal, seems like it is code 302

Output from my terminal, seems like it is code <code>302</code>

I am using Ueberauth, Elixir, Phoenix.

Matthew
  • 33
  • 6

2 Answers2

1

I found where the problem was.

I had problem that I just copy-pasted code from ueberauth_github and replaced the GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET with my own. config :ueberauth

There is a problem that it calls System.get_env. So I changed it to:

enter image description here

Now it works.

Matthew
  • 33
  • 6
  • 5
    I believe the client_id and client_secret are meant to be private and they cannot be shared. I would recommend you to ask for a new secret on GitHub UI, if possible, and remove the image from here. :) – José Valim Jan 13 '18 at 14:17
  • It was just for learning and development purposes, thanks for suggestions :) in production I will hide it somehow, anyway, could you recommend me some nice way to do that, or some nice pattern in real world to hide those data? – Matthew Jan 15 '18 at 14:43
0

When you create variables in .env you need to source that too so it will work in your project directory by running the following command in terminal

source .env

if .env is in any folder e.g config/.env then

source config/.env

I had a same issue with little research its fixed with this command.

Hassam Ali
  • 171
  • 2
  • 12