Home > @vsf-enterprise/ct-auth0 > isAuthenticated

# isAuthenticated() function

Nuxt.js middleware preventing unauthenticated customers from accessing protected routes

Signature:

export declare function isAuthenticated({ $vsf, redirect, req }: {
    $vsf: any;
    redirect: any;
    req: any;
}): Promise<any>;

# Parameters

Parameter Type Description
{ $vsf, redirect, req } { $vsf: any; redirect: any; req: any; }

Returns:

Promise<any>

# Example

To you use, import if from the @vsf-enterprise/ct-auth0 package and pass to middleware property in Vue.js component:

import { isAuthenticated } from '@vsf-enterprise/ct-auth0';

export default {
  middleware: [
    isAuthenticated
  ]
}