supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Auth tokens stacking and causing 431

Open bootsmann1995 opened this issue 6 months ago • 0 comments

Hello I'm quite new at using supabase. Every time i update an user i get antoher token in my application cookies. This is stacking and causing the browser to throw an http 431. I'm using nuxt and the supabase nuxt module.

I'm updating the user 1-10 times a day and can happend within 5 min. this is the code i use to update my user metadata: const updateUser = async (data: any) => { try { const updatedUser = await supabase.auth.updateUser({ data }); return updatedUser; } catch (error) { console.error("Error updating user:", error); throw error; } };

heres the network stacked data: image

and heres an example of user_metadata: https://pastebin.com/jrCtZGND

Version

@nuxtjs/supabase: nuxt:

Reproduction Link

https://booty-ai.nuxt.dev/

Steps to reproduce

  1. go to https://booty-ai.nuxt.dev/signup
  2. login https://booty-ai.nuxt.dev/
  3. go to https://booty-ai.nuxt.dev/feed
  4. add point and refresh page 2-3 times
  5. the error happends

Don't know if im using the update user wrong, but the use case is i have a neews/education feed via chat bot gemini. So it's basically just multiple chat instances running on the user feed. But automated. So this needs an user update for every news feed updated (once a day when in production). So the user meta data is updated when the news feed has been updated.

bootsmann1995 avatar Aug 23 '24 11:08 bootsmann1995