GithubHelp home page GithubHelp logo

Comments (3)

SergejSi avatar SergejSi commented on September 27, 2024

I am experiencing the same issue, but I am using Next.js 14.2.3. The behavior is identical: the user gets redirected to the login page instead of the change password page after clicking the reset password link. Any solutions or workarounds would be greatly appreciated.

from supabase.

ek-ma avatar ek-ma commented on September 27, 2024

Apparently, Nuxt's middleware is ran 2 times : first during the server side rendering and a second time during the hydration process (client side)
By logging, I noticed that the user is not connected in the server side middleware but it is in the client side.

As a workaround, I added a return statement in my middleware when running server side like so :

export default defineNuxtRouteMiddleware(async () => {
    if (import.meta.server) return

    const user = useSupabaseUser()
    if (!user.value) {
        const localePath = useLocalePath()
        return await navigateTo(localePath('login'))
    }
})

I believe you should be able to do the same thing using Next.js

But that is not ideal : you would prefer to be connected server side, since this workaround allows the user to have a glimpse at the page during its loading time but i have no idea how & no answer to this issue so far.

from supabase.

encima avatar encima commented on September 27, 2024

As @ek-ma said, this is expected behaviour of Nuxt, although not ideal behaviour this is the recommended implementation from Nuxt.

I would close this for now as it is Framework specific behaviour rather than a bug with Supabase.

If you do want to add it to the docs, feel free to open a PR and we can reopen this while the PR is in review!

from supabase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.