mtamc / memo

Website for rating books, movies, video games, and TV shows.
0 stars 0 forks source link

"Response with status 401" viewing profiles/lists when not logged in #32

Closed dustinvtran closed 2 years ago

dustinvtran commented 2 years ago

When not logged in, I can see profiles and lists fine (both local server and on website). which is great (fixed from https://github.com/td-memo/memo/issues/30).

When viewing lists, the logs still say error 401 though, which suggests something may still be wrong behind the scenes?

◈ Rewrote URL to /.netlify/functions/name
Request from ::1: GET /.netlify/functions/name
Response with status 401 in 4 ms.

Here's when viewing the profile.

◈ Rewrote URL to /.netlify/functions/name/nil
Request from ::1: GET /.netlify/functions/name/nil
Response with status 200 in 176 ms.
◈ Rewrote URL to /.netlify/functions/entries/games/nil
◈ Rewrote URL to /.netlify/functions/entries/films/nil
Request from ::1: GET /.netlify/functions/entries/games/nil
◈ Rewrote URL to /.netlify/functions/entries/books/nil
Request from ::1: GET /.netlify/functions/entries/films/nil
◈ Rewrote URL to /.netlify/functions/entries/tv_shows/nil
◈ Rewrote URL to /.netlify/functions/name
Request from ::1: GET /.netlify/functions/entries/books/nil
Request from ::1: GET /.netlify/functions/entries/tv_shows/nil
Request from ::1: GET /.netlify/functions/name
Response with status 401 in 2 ms.
Response with status 200 in 1629 ms.
Response with status 200 in 2187 ms.
Response with status 200 in 3496 ms.
Response with status 200 in 4253 ms.

Going to http://localhost:8888/.netlify/functions/name says "undefined". The log says

Request from ::1: GET /.netlify/functions/name
Response with status 401 in 2 ms.
ghost commented 2 years ago

nothing is broken but there are two minor issues to fix here. first is I'm using 401 for control flow when I should be using regular data to not pollute logs. second is I need to pipe the request result into four children instead of having the four lists make the request

On Tue, Feb 1, 2022, 7:50 PM Dustin Tran @.***> wrote:

When not logged in, I can see profiles and lists fine (both local server and on website). which is great (fixed from #30 https://github.com/td-memo/memo/issues/30).

When viewing lists, the logs still say error 401 though, which suggests something may still be wrong behind the scenes?

◈ Rewrote URL to /.netlify/functions/name

Request from ::1: GET /.netlify/functions/name

Response with status 401 in 4 ms.

Here's when viewing the profile.

◈ Rewrote URL to /.netlify/functions/name/nil

Request from ::1: GET /.netlify/functions/name/nil

Response with status 200 in 176 ms.

◈ Rewrote URL to /.netlify/functions/entries/games/nil

◈ Rewrote URL to /.netlify/functions/entries/films/nil

Request from ::1: GET /.netlify/functions/entries/games/nil

◈ Rewrote URL to /.netlify/functions/entries/books/nil

Request from ::1: GET /.netlify/functions/entries/films/nil

◈ Rewrote URL to /.netlify/functions/entries/tv_shows/nil

◈ Rewrote URL to /.netlify/functions/name

Request from ::1: GET /.netlify/functions/entries/books/nil

Request from ::1: GET /.netlify/functions/entries/tv_shows/nil

Request from ::1: GET /.netlify/functions/name

Response with status 401 in 2 ms.

Response with status 200 in 1629 ms.

Response with status 200 in 2187 ms.

Response with status 200 in 3496 ms.

Response with status 200 in 4253 ms.

— Reply to this email directly, view it on GitHub https://github.com/td-memo/memo/issues/32, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKFEJHUBTVXA2I7KZNL6QTUZATOPANCNFSM5NJ7H6ZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

ghost commented 2 years ago

no longer 401: a00f759 request is still done multiple times but let's not address that for now (if we migrate to react there will be such massive changes this will definitely be fixed in the process)