Closed nelsonic closed 1 year ago
This is quite strange. I'm adding dbg/1
statements to the transform_github_profile_data_to_person/1
function to try and get to the bottom of this. 🤞
Not using latest version of Elixir
on auth
so got the following error:
#24 2.585 == Compilation error in file lib/auth/person.ex ==
#24 2.585 ** (CompileError) lib/auth/person.ex:124: undefined function dbg/1
#24 2.585 (elixir 1.12.3) src/elixir_locals.erl:114: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
#24 2.585 (stdlib 3.16.1) erl_eval.erl:685: :erl_eval.do_apply/6
Need to go and find a line to update the Dockerfile
:
https://github.com/dwyl/auth/blob/f6a72102fd72f99ba8c42d00083e22c2fdec917a/Dockerfile#L15
Borrowing Dockerfile
from: https://github.com/dwyl/phoenix-chat-example/blob/baba16a988f65851c7c0c95ba2c2b31cfdb027e8/Dockerfile
@LuchoTurtle This is working for me on my localhost:
Please confirm on your side by visiting: https://authdemo.fly.dev/people
Where you person.username
is displayed in the Username
column.
I logged the JWT on returned by auth
( https://authdemo.fly.dev ) and it includes the username
now:
%{
app_id: 2,
aud: "Joken",
auth_provider: "github",
email: "rex@gmail.com",
exp: 1700745867,
givenName: "Rex Dangervest",
iat: 1669208867,
id: 7,
iss: "Joken",
jti: "2sl3h7ncd22cnc3cck12h",
nbf: 1669208867,
picture: "https://avatars.githubusercontent.com/u/10835816?v=4",
roles: "6,6",
sid: 76,
status: 1,
username: "nkamc"
}
This works on my side, it shows the username.
But I think there's something up in auth_plug
, the username is not present at all. https://github.com/dwyl/phoenix-chat-example/pull/120#issuecomment-1325073845
This issue should be resolved in auth
, but not so much in auth_plug
🤔
Aaaaah, it works now.
I had to Reset API key
So previous registered apps need to refresh so the JWT brings the username
.
I didn't refresh my API key. But I'm glad that resetting yours worked. There aren't any other Apps using this auth
instance so nobody else
should see this issue in practice. 👌
As noted by @LuchoTurtle in https://github.com/dwyl/phoenix-chat-example/pull/120#issuecomment-1323509260 his
username
does not appear when he logs in viaAuth
.The GitHub
profile.login
should be set to theperson.username
by this line: https://github.com/dwyl/auth/blob/f6a72102fd72f99ba8c42d00083e22c2fdec917a/lib/auth/person.ex#L126But for some reason it's not appearing when @LuchoTurtle logs in on the Auth Demo App: https://authdemo.fly.dev/people
This appears to be the case on the "prod" version of auth too: https://auth.dwyl.com/people/141 So we need to debug this stat! 👨💻 🔥