import { Context , Middleware } from '@nuxt/types' ; const redirectMiddleware = ( { store , redirect , route } ) => { const notRequiredAuthorization = [ '/' , '/counter' ] ; if ( notRequiredAuthorization . includes ( route . path ) ) { return ; } if ( store . getters [ 'qiita/isAuthorized' ] ( ) === false ) { return redirect ( '/' ) ; } } ; export default redirectMiddleware ;