trandaison / nuxt-3-auth

A simple authentication module for Nuxt 3
https://nuxt-3-auth.github.io
57 stars 5 forks source link

Disable the built-in /login? #14

Closed Stiropor closed 5 months ago

Stiropor commented 5 months ago

Is it possible to somehow completely remove the /login from package? I have the same route and would like to use my own form that is styled like the rest of website.

trandaison commented 5 months ago

Hi @Stiropor There is no way to completely remove the /login page yet. However, if you want to use your own login page, you can override the routes option like this

// nuxt.config.ts
import { resolve } from 'pathe';

export default defineNuxtConfig({
  auth: {
    routes: {
      login: {
        name: 'login',
        file: resolve(__dirname, './pages/login.vue'),
        path: '/login',
      },
    },
  },
});

Please note that don't change the name: 'login' property. You can resolve any page component for the login page, or change the login path (to /sign-in, for example`)

Stiropor commented 5 months ago

Thank you, @trandaison, I saw this options but somehow thought it'd still be using your component.