wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Find a way to avoid getting 401 from server when user is not logged in

Open Martinsos opened this issue 1 year ago • 5 comments

In Wasp, when on a page that requires auth user, client will ask server to get the user via auth/me route, which will then return 401 if user is not authenticated. We just ignore that 401 and go with it.

The thing is, this 401:

  1. Confuses people, they think it is a potential issue (we had person asking about it in Discord).
  2. Confuses Cypress (e2e testing): it thinks error happened and test fails unless you explicitly set it to not fail. https://discord.com/channels/686873244791210014/1216893853890510908/1216893853890510908

Martinsos avatar Mar 12 '24 09:03 Martinsos

@Martinsos I would like to resolve this issue. Could you please assign it to me ?

yashvardhan-verma avatar Jun 02 '24 12:06 yashvardhan-verma

@yashvardhan-verma I can but I am not sure I would advise this as an issue for beginner, it will turn out quite complex if you are contributing to Wasp for the first time!

Martinsos avatar Jun 04 '24 11:06 Martinsos

An example of this confusing a user: https://discord.com/channels/686873244791210014/1261035836409905316/1261285553744121877

sodic avatar Jul 25 '24 11:07 sodic

Another one: https://github.com/wasp-lang/open-saas/issues/253

sodic avatar Aug 26 '24 09:08 sodic

Related discord convo: https://discord.com/channels/686873244791210014/1301166568381747250/1301166568381747250 -> it seems to also negatively affect SEO / webpage performance scores, because it seems as if there is an error on the page.

Martinsos avatar Oct 30 '24 15:10 Martinsos