Supauth

Nuxt Layer with all you need to start your next Nuxt + Supabase project without having to worry about the auth system.

Repository: https://github.com/imlautaro/supauth

Documentation: https://supauth.vercel.app/

supauth

Getting started

Installation

npm install -D supauth

Register layer

Add to your nuxt.config.ts.

export default defineNuxtConfig({  extends: ['supauth'],})

Usage

To start using this layer, just follow the setup instructions and create a .env file with your Supabase credentials:

// .envSUPABASE_KEY=SUPABASE_URL=

Then, you can run your project and go to /login to sign in or /register to create a new user.

Since this layer is using the @nuxtjs/supabase module, you can of course use all the functions and utilities coming from that module (useSupabaseClient, useSupabaseUser, etc).

Options

export default defineAppConfig({    supauth: {        confirm: true, // enable if you have email confirmation on        redirect: '/', // the path you want to redirect your users after login        providers: ['google', 'github'], // the oauth providers you want to enable        legalAdvice: {            privacy: '/privacy-policy',            terms: '/terms-and-conditions',        }, // legal links to show below the auth forms. you can set it to false to don't show any legal advice    },})

Middlewares

  • authenticated (if there isn’t a user logged-in, you’re gonna be redirected to /login)
  • unauthenticated (if there is a user logged-in, you’re gonna be redirected to /, or the redirect path in the options of the layer.