Firefox app log in - Request failed with status code 400

Hey there -

User login works fine on Chrome - but testing on firefox, I get “Request failed with status code 400”

However, when refreshing the page, I’m logged in, taking me to the dashboard.

Is this a bug? Or am I missing something?

Thanks!

Hi @creativemusic :wave:

This happens when you are trying to login to WeWeb or to the app you built in WeWeb?

If it’s logging into WeWeb, can you create a bug report here?

If it’s logging into your live app built with WeWeb, can you share what the API call response looks like in your browser’s inspector?

In case you’re not familiar with the browser inspector, here’s a short video on how it looks on Chrome. The words and layout may vary slightly with Firefox but the logic will be similar.

Appreciate you making the video @Joyce

It’s my app, not logging into weweb. it’s happening in a chrome private window, but not on a regular tab. It is happening on chrome mobile and and firefox.

With a page refresh, I’m logged in.

I’m using supabase auth and was having no issues. App has been live, with users for about a week. This is new, out of the blue. I discovered it from a support ticket yesterday.

For the call you pointed to in the video, there is no error in the response. It is authenticating:

The error is coming from here (it says preview, but this is the published app I’m testing for this):

https://1658c8b9-8099-43e1-a757-e9369ff517ac.weweb-preview.io/ww/cms_data_sets/cce0e519-8ff6-4b93-9d84-ec4904d89478/fetch?limit=100&offset=0

The response (replacing sensitive info with “xyz”:

{“data”:null,“error”:{“message”:“Request failed with status code 400”,“name”:“AxiosError”,“config”:{“transitional”:{“silentJSONParsing”:true,“forcedJSONParsing”:true,“clarifyTimeoutError”:false},“transformRequest”:[null],“transformResponse”:[null],“timeout”:0,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1,“maxBodyLength”:-1,“env”:{},“headers”:{“Accept”:“application/json, text/plain, /”,“Content-Type”:“application/json”,“Authorization”:“xyz”,“User-Agent”:“axios/0.27.2”,“Content-Length”:16},“method”:“post”,“params”:{“apikey”:“xyz”},“data”:“{"_donor_id":""}”,“url”:“https://xyz.supabase.co/rest/v1/rpc/get_donor_access"},“code”:“ERR_BAD_REQUEST”,“status”:400},“type”:"single”}

Here’s from the supabase auth logs:

{“event_message”:"{"component":"api","duration":706606,"level":"info","method":"POST","msg":"request completed","path":"/token","referer":"https://portal.creativemusic.org/\“,\“remote_addr\”:\”,xyz\“,\“status\”:400,\“time\”:\“2023-11-17T12:23:57Z\”,\“timestamp\”:\“2023-11-17T12:23:57Z\”}”

Let me know if you need any other info.

Thanks Joyce!
Mitch

Ah - I fixed it. Looking closer at the error, it was from a failed API call I was making between log in and redirect. I’ve removed that and it’s working.

Thanks for guiding me to the answer :slight_smile:

1 Like

Oooh awesome, thanks for taking the time to share the solution!