Repository navigation
Conversation
kangmingtay
left a comment
There was a problem hiding this comment.
Hey @oiojin831, thanks for your contributions, please add tests as well and take a look at the contributing guide for adding a new oauth provider! Thanks!
There was a problem hiding this comment.
thanks I will check the contributing guide again :D
|
|
||
| func (g kakaoProvider) GetUserData(ctx context.Context, tok *oauth2.Token) (*UserProvidedData, error) { | ||
| var u kakaoUser | ||
| if err := makeRequest(ctx, tok, g.Config, g.APIPath+"/v2/user/me", &u); err != nil { |
There was a problem hiding this comment.
since the kakao api requires the developer to pass 2 additional parameters: property_keys and secure_resource, you can't use the wrapper function makeRequest, you'll need to construct the http request on your own (much like the notion implementation)
There was a problem hiding this comment.
ok I will refer the notion implementation to fix it. :D
There was a problem hiding this comment.
@kangmingtay I am actually not familiar with golang, could you give me a help to write a debug code?
I was trying to print some log but I couldn't figure out how to do it.
Thank you
There was a problem hiding this comment.
you can either use the fmt or log package to print the http response returned from /v2/user/me inside makeRequest
If you want to print the contents of a struct, you can try this:
var u kakaoUser
fmt.Printf("%+v", u)It might also be worth taking a look at the tour of go to familiarise yourself with the language :)

Adding a new provider
If I go to this url
http://localhost:9999/authorize?provider=kakaoIt will redirect to "agreement page?"

After I agree with everything.
it will redirect to
http://localhost:3000/?error=server_error&error_description=Error+getting+user+email+from+external+provider
It seems that I am not able to get my email, could anyone help me to debug this?
Since I am not familiar with golang, I couldn't find a way to log the debug message.
Could anyone help me with this.
Thanks.