auth.js 238 B

12345678
  1. import { getToken } from "~/utils/auth"
  2. export default function (context) {
  3. if (process.client && !getToken()) {
  4. context.redirect(302, {path: `/auth/login?redirect=${encodeURIComponent(context.route.fullPath)}`})
  5. return;
  6. }
  7. }