[Python] Flask - Supabase restrict non auth users from accessing pages

Discussão em 'Python' iniciado por Stack, Agosto 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to implement some security to my website. I can currently log users into my website and it writes to the DB in supabase. However, I have been trying to implement security so that only users that are logged in can use certain pages. So far I have been struggling to pass a session from the front end to the flask app. I keep getting stuck in a loop where the user is logged into the account and it tries to redirect to /home but /home is a protected url and as it has no session logged my backend logic redirects to my signin page and therefore an infinite loop. Are there any other ways in which to restrict certain urls from unauthenticated users? Do you have a solution that could help me?

    Thank you in advance!

    Continue reading...

Compartilhe esta Página