Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supabase Auth Warning #391

Closed
ifzm opened this issue Jul 16, 2024 · 6 comments
Closed

Supabase Auth Warning #391

ifzm opened this issue Jul 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ifzm
Copy link

ifzm commented Jul 16, 2024

Version

@nuxtjs/supabase: 1.3.5
nuxt: 3.12.3

Reproduction Link

Steps to reproduce

const user = useSupabaseUser()
watchEffect(() => {
    if (user.value) {
        navigateTo('/')
    }
})

What is Expected?

no warning (

What is actually happening?

 WARN  Using the user object as returned from supabase.auth.getSession() or from some  
 supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage  
 medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead  
 which authenticates the data by contacting the Supabase Auth server.  
@ifzm ifzm added the bug Something isn't working label Jul 16, 2024
@larbish
Copy link
Collaborator

larbish commented Jul 16, 2024

This warning is related to the supabase/ssr lib. Can you please upvote this issue to encourage the Supabase maintainers to address it?

@ifzm
Copy link
Author

ifzm commented Jul 17, 2024

OK, I'll do it.

@ifzm ifzm closed this as completed Jul 17, 2024
@brentreilly
Copy link

brentreilly commented Jul 24, 2024

I upvoted it as well. In the meantime, do you have any recommendations? Doesn't seem to be negatively impacting my app.

Copy link
Collaborator

larbish commented Jul 29, 2024

It's not impacting your app. Let's wait for the fix from the Supabase team.

@oripka
Copy link

oripka commented Aug 30, 2024

Just updated from 1.2.2 to 1.4.0 and getting this issue now, before it was fine with the same code

@Eckhardt-D
Copy link

Just leaving my hack here for anyone who cannot deal with the log messages lol. It probably only works for package managers that can do patching and I'll use pnpm as an example:

pnpm patch @supabase/auth-js

Remember/store the output to run to commit your patch when done with the following

Now cd to the /tmp/xxx path and edit the following files:

  • dist/main/GoTrueClient.js
  • dist/module/GoTrueClient.js

What to edit?

I did a find for console.warn and on lines 822 and 817 respectively I just added a // in front of the line logging Using the user object ....

When done, cd back to the project and run

pnpm patch-commit `/tmp/xxxx`

Unfortunately this silences the log for real insecure usage too, so that's a trade-off you'll have to make for cleaner dev logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants