GithubHelp home page GithubHelp logo

kevinzunigacuellar / astro-supabase Goto Github PK

View Code? Open in Web Editor NEW
155.0 155.0 41.0 202 KB

Astro and Supabase auth and database demo

Home Page: https://astro-supabase-auth.vercel.app

License: MIT License

JavaScript 2.88% Astro 58.54% TypeScript 38.58%
astro supabase

astro-supabase's Introduction

astro-supabase's People

Contributors

kevinzunigacuellar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

astro-supabase's Issues

Protected Routes

Protected routes in middleware.ts will fail to identify the protected route if the protected route has a trailing "/" such as "/dashboard/"

In short:

if (protectedRoutes.includes(url.pathname)) will return true for "/dashboard" , but false for "/dashboard/", thus allowing access to the protected route.

You can either add both "/dashboard" and "/dashboard/" to your protected routes array, or add some code to remove all "/" from url.pathname, and then just put "dashboard" in your protected routes array.

This would work with the requested path being either /dashboard or /dashboard/

// remove the slash in the protected route array

const protectedRoutes = ["dashboard"];

// add .split with the .join to the url.pathname to remove all slashes from the url.pathname

if (protectedRoutes.includes(url.pathname.split('/').join("")))

Password Reset Flow

Hi,
Sorry for bugging you. I went through your repo and it is soo clean and clear. This is the simplest and robust authentication with Supabase and Astro.
I want your opinion on how to implement Password reset flow for the user. I currently use this feature but it doesn't look clean in my code. If possible you can implement the password reset feature to your repo.
I am looking at something like the way it is described in supabase docs.
User forgot password

I would be very grateful to you if you could do this. Anyway thanks for your current repo, it helped me a lot.

Thank you.

GET and POST on /api/guestbook are working without being logged in

Hello ๐Ÿ‘‹

First, thank you for this repo!

I found a vulnerability for the /api/guestbook endpoint, we don't need to be logged in to add or read guestbooks.

How to reproduce?

Sign out from the dashboard, open the dev console and past this.

await fetch("https://astro-supabase-auth.vercel.app/api/guestbook", {
    method: "POST",
    body: '{"name":"it","message":"works"}'
})

How to fix?

I think if you had some logic to retrieve the current session and user here ๐Ÿ‘
We have the cookies sent in the headers, we can use them I think

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.