Basic Auth


This middleware will implement Basic Auth in your application. Only users with correct credentials passed to the browser prompt will be able to see the application. Others will be automatically rejected.

You can learn more about HTTP Authentication here.

export type BasicAuth = {  exclude?: string[];  name: string;  pass: string;  enabled: boolean;  message: string;}

To write a custom logic for this middleware follow this pattern:

nuxt.config.ts
export default defineNuxtConfig({  security: {    basicAuth: {      exclude: ['/api'],      name: 'test',      pass: 'test',      enabled: true,      message: 'test'    }  }})