import { storage } from '@inside-library/helpers/Storage'

export default ({ next }) => {
  if (
    storage.get('current-user') &&
    !storage.get('current-user').permissions.custom.includes('access dashboard')
  ) {
    next('/')
  }

  next()
}
