Remix Supabase Auth

Overview

Remix Supabase Auth

Bare minimum and un-opinionated example using Remix to implement Supabase's email/password and oAuth

Features

  • Signin and Register using Supabase's email/password, Google, and Facebook auth
  • Integration for all oAuth providers that Supabase supports
  • Easily enable any oAuth provider - see extend section
  • Persist user with HTTP cookie
  • Refresh token logic implemented
  • Bare minimum and un-opinionated
  • main branch is Typescript but you can access JavaScript project in js branch

Quick Start

  • Create Supabase project (skip if you already have one):
    • Create Supabase account
    • Create an Organization and a project
    • Visit API settings page of your project by either going to https://app.supabase.io/project/ /settings/api or clicking on the Settings on the left sidebar > click on API under Project settings. You'll find your anon_key and URL on that page, which will be used in the next step.
  • Clone this example and rename/copy .env.example to .env and add SUPABASE_ANON_KEY, and SUPABASE_URL
  • Add your Google and Facebook client ID and secret to your Supabase project, follow the steps mentioned in the Supabase's documentation for Google and Facebook
  • Install npm dependencies by running npm i/npm install or yarn

Development

  • run the development server with npm run dev or yarn dev

What you'll get?

Register - Register using email/password or continue with Google/Facebook social authentications

Login - Login using email/password or continue with Google/Facebook social authentications. When logging in using a Google/Facebook account that is not registered in Supabase, Supabase will create a new account with that email

Auth Callback - Handles the callback from Supabase when oAuth providers are used to login or register. This route uses supabase.auth.onAuthStateChange to get the access and refresh tokens from the url and then it submits the FormData to create session on the server

Profile - Only accessible when logged in, otherwise throws an error which is caught by Remix's CatchBoundary and asks user to login. Once logged in, it'll show the User object that is returned from Supabase

Logout - Logs user out of the local session and Supabase session. It is an api/resource route because it doesn't export a JSX element

Extend Implementation

Add other oAuth providers
  • Simply add the client ID and secret to Supabase for the provider that you want to support.
  • In login.tsx and register.tsx add the and that's it!

Questions?

Please feel free to hit me up on Twitter or opening an Issue

License

MIT

You might also like...

A collection of social media strategies for remix-auth

Remix Auth Socials A collection of Remix Auth strategies for Oauth2 Social logins. 👷 If you are interested in creating one of the planned strategies,

Jan 5, 2023

Remix Auth plugin for Twitter OAuth 1.0a

Remix Auth Twitter Remix Auth plugin for Twitter OAuth 1.0a. Supported runtimes Runtime Has Support Node.js ✅ Cloudflare ✅ Demo Try out live demo (sou

Dec 31, 2022

The Remix version of the fakebooks app demonstrated on https://remix.run. Check out the CRA version: https://github.com/kentcdodds/fakebooks-cra

Remix Fakebooks App This is a (very) simple implementation of the fakebooks mock app demonstrated on remix.run. There is no database, but there is an

Dec 22, 2022

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

💿 Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Dec 9, 2022

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.

💿 Remix Fundamentals Build Better websites with Remix Remix enables you to build fantastic user experiences for the web and feel happy with the code

Dec 25, 2022

simple-remix-blog is a blog template built using Remix and TailwindCSS. Create your own blog in just a few minutes!

simple-remix-blog is a blog template built using Remix and TailwindCSS. Create your own blog in just a few minutes!

simple-remix-blog is a blog template built using remix.run and TailwindCSS. It supports markdown and MDX for the blog posts. You can clone it and star

Dec 8, 2022

Example project implementing authentication, authorization, and routing with Next.js and Supabase

Example project implementing authentication, authorization, and routing with Next.js and Supabase

Magic Link Authentication and Route Controls with Supabase and Next.js To run this project, To get started with this project, first create a new proje

Dec 11, 2022

Work from is a web app created by Josh Cawthorne for the Supabase Hackathon.

Work from is a web app created by Josh Cawthorne for the Supabase Hackathon.

Work From What is Work From? Work from is a web app created by Josh Cawthorne for the Supabase Hackathon. The concept of the app is for companies to b

Jan 3, 2023

Supabase client initialization and encapsulation in fastify framework

fastify-supabase Supabase client initialization and encapsulation in fastify framework. Install Install the package with: npm i fastify-supabase --sav

Aug 2, 2022

Boilerplate for a NextJS and Supabase Project. Including full authentication with sign up, login and password recovery.

NextJS x Supabase Boilerplate Getting Started Environment variables Create the enviroment variables with the following command cp .env.local.dist .env

Jun 13, 2022

Third-Party Authentication (Github) demo Vue 3 + TypeScript + Pinia app using Supabase

vue-supabase-tpa-demo This template should help get you started developing with Vue 3 in Vite. Recommended IDE Setup VSCode + Volar (and disable Vetur

Nov 21, 2022

🧩 Create code snippets anywhere (beta). Built with Nextjs & Supabase.

🧩 Create code snippets anywhere (beta). Built with Nextjs & Supabase.

🧩 Codetypes (beta) Codetypes is a web application to create code snippets in the cloud, without installation and totally free. You can run Codetypes

Feb 25, 2022

Next.js + Prisma + Supabase simple Blog example

Next.js + Prisma + Supabase Blog Project About the Project Prisma connects the PostgreSQL Database provided by Supabase by using postgres connection s

Nov 19, 2022

cms for next.js based on supabase for developers.

one cms for next.js based on supabase for developers. disclaimer one is in early and active development and currently not functional. all the @one pac

Aug 27, 2022

⚡ A blazing fast, lightweight, and open source comment system for your static website, blogs powered by Supabase

⚡ A blazing fast, lightweight, and open source comment system for your static website, blogs powered by Supabase

SupaComments ⚡ A blazing fast, lightweight, and open source comment system for your static website, blogs 🚀 Demo You can visit the Below demo blog po

Dec 27, 2022

ChatMore: A web chatapp like Whatsapp - Made in Typescript, React and Supabase

ChatMore: A web chatapp like Whatsapp - Made in Typescript, React and Supabase

ChatMore This project is a chatapp made in React. On the main page we can authenticate, and then add todos to the our list. The ultimate goal of this

Jan 3, 2023

This is a project to make the supabase REST API available from PrismaClient.

This is a project to make the supabase REST API available from PrismaClient.

sb-prisma 🔧 This project is experimental and not yet stable, so please use with caution. We look forward to your contributions. ⚠️ For non-node runti

Jul 6, 2022

tooldb is a (soon) massive collection of frameworks and tools. It's build on Flowbite, Next.js, Tailwind CSS and uses Supabase.

tooldb is a (soon) massive collection of frameworks and tools. It's build on Flowbite, Next.js, Tailwind CSS and uses Supabase.

tooldb is a (soon) massive collection of frameworks and tools. It's build on Flowbite, Next.js, Tailwind CSS and uses Supabase.

Jul 14, 2022

⚡️ CRUDify Supabase Tables

⚡️ CRUDify Supabase Tables ⚡️ This is a wrapper around @supabase/supabase-js that generates CRUD actions (like Prisma) to manage tables' data. Quickst

Oct 14, 2022
Comments
  • Social logins return 404

    Social logins return 404

    Hey, I recently cloned your repo and set it up with the instructions provided, but when i click on either google / facebook login, i get the below error.

    Screenshot 2022-03-15 at 17 02 52

    The url after you click the google button is: http://localhost:3000/=https://<my-supabase-url>.supabase.co/auth/v1/authorize?provider=google&redirect_to=http%3A%2F%2Flocalhost%3A3000%2Fprofile

    question 
    opened by danielvanc 4
Owner
Arpit Dalal
Software Engineer
Arpit Dalal
Simple JWT Auth With TRPC prisma & next

Simple JWT Auth With TRPC prisma & next A sample JWT authentication using prisma, @trpc/server @trpc/client @trpc/react in Next.js Simple Usage copy .

Aris Riswanto 4 Aug 23, 2022
Remix Stack for deploying to Vercel with remix-auth, Planetscale, Radix UI, TailwindCSS, formatting, linting etc. Written in Typescript.

Remix Synthwave Stack Learn more about Remix Stacks. npx create-remix --template ilangorajagopal/synthwave-stack What's in the stack Vercel deploymen

Ilango 56 Dec 25, 2022
A collection of framework specific Auth utilities for working with Supabase.

A collection of framework specific Auth utilities for working with Supabase.

Supabase Community 507 Jan 2, 2023
Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Supabase auth, frontend + backend - example with Next.js Learn how to set up Supabase auth for both the frontend and backend of your application using

YK 7 Nov 20, 2022
Auth-Form-Design - Beautiful Auth Form Designed using React 🥰.

?? Auth Form Design ?? Features 1. Check Your Password Strength 2. Can Use Suggested Password 3. Enjoy Responsive Design Getting Started with Create R

Samarpan Dasgupta 2 Dec 24, 2022
Source code for the deprecated expo-google-app-auth package. Deprecated in favor of expo-auth-session.

expo-google-app-auth Source code for the deprecated expo-google-app-auth package. Expo Google App Auth API wrapped the deprecated expo-app-auth packag

Expo 4 Nov 2, 2022
Firebase adepter auth process with custom token example in Next Auth

Firebase adepter auth process with custom token example in Next Auth Example of a firebase adapter that works with firebase authentication. A firebase

Low Front 10 Oct 14, 2022
The Remix Stack for deploying to Fly with Supabase, authentication, testing, linting, formatting, etc.

Remix Supa Fly Stack Learn more about Remix Stacks. npx create-remix --template rphlmr/supa-fly-stack What's in the stack Fly app deployment with Doc

Raphaël Moreau 157 Jan 7, 2023
The Remix Stack with Clerk authentication, Supabase database, Chakra UI, testing, linting, and more.

Remix Bossa Nova Stack Learn more about Remix Stacks. What's in the stack User management with Clerk Database with Supabase Styling with Chakra UI Dep

Clerk 32 Jan 2, 2023
A Remix Auth strategy for working with forms.

FormStrategy A Remix Auth strategy to work with any form. Supported runtimes Runtime Has Support Node.js ✅ Cloudflare ✅ How to use This Strategy gives

Sergio Xalambrí 40 Jan 2, 2023