import { Context } from "@nuxt/types/app";
import { RootState } from "~/store";

// Middlewhich which only allows authenticated users
// to view a page, even when anonymous mode is active.

export default function (context: Context) {

	const state: RootState = context.store.state;

	if(state.profile?.role != "admin") {
		context.redirect('/');

		return;
	}
}