open-sauced / hot

🍕The site that recommends the hottest projects on GitHub.
https://hot.opensauced.pizza
MIT License
418 stars 143 forks source link

API Key is not working #512

Closed jimbobbennett closed 6 months ago

jimbobbennett commented 6 months ago

Not sure if this is the right repo for this - I generated an API token following the docs, and I'm still getting unauthorized when I call the API.

image
nickytonline commented 6 months ago

Hmmm, my coworker @brandonroberts did a quick the and the token generated works with https://api.opensauced.pizza/#/Authentication%20service/checkAuthSession

jpmcb commented 6 months ago

This is working for me:

curl -X 'GET' \
  'https://api.opensauced.pizza/v2/auth/session' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <redacted>'

where I grabbed my token from the hot.opensauced.pizza "Print auth token" method.

A few things to note:

jimbobbennett commented 6 months ago

Well found the issue...

It seems if I generate the token with Safari, it's not valid and I get a 401. If I use Edge it works.

Looks like Safari is truncating the API Key in the console output. There's a .<something> on the end of the key that Safari is losing.

Maybe something to add to the docs? I'll close this issue for now, thanks @nickytonline and @jpmcb

nickytonline commented 6 months ago

I'll go ahead and create an issue for that. Thanks @jimbobbennett!