I am working on creating a route middleware in TypeScript that will validate the request.meta.auth
field from the request object. I want to ensure this field has autocomplete options of 'user' and 'guest':
export default defineNuxtRouteMiddleware((request) => {
request.meta.auth // To support autocomplete for 'user' and 'guest'
});
Can anyone advise on how to achieve this?
My attempt so far:
declare module "nuxt" {
interface RouteLocationNormalized {
meta: {
auth: TAuthVariant;
};
}
}
However, this approach did not give the desired result.