Documentation

guard

Guard use to check permission for route

TypeScript
import { guard, handler, t, type Store } from 'mantou'

const auth = (roles: string[]) => guard(async () => {
  console.log('Auth guard: ', roles);
  return true // return boolean only
})

Search