aboutsummaryrefslogtreecommitdiff
path: root/src/site/middleware/admin.js
blob: 1a94b750aa5166387d1e32f53e2691c5a2858742 (plain) (blame)
1
2
3
4
5
6
export default function ({ store, redirect }) {
	// If the user is not authenticated
	if (!store.state.auth.user) return redirect('/login');
	if (!store.state.auth.user.isAdmin) return redirect('/dashboard');
	return true;
}