Skip to content

Commit 587bd74

Browse files
committed
redirect fix for admin vs non-admin
1 parent 3b72f74 commit 587bd74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

builderbook/lib/withAuth.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ export default function withAuth(
4343
}
4444

4545
if (logoutRequired && user) {
46-
Router.push('/public/login', '/login');
46+
if (!user.isAdmin) {
47+
Router.push('/customer/my-books', '/my-books');
48+
return;
49+
}
50+
51+
Router.push('/admin');
4752
}
4853
}
4954

0 commit comments

Comments
 (0)