cleaning things up

This commit is contained in:
Arjun Patel
2022-01-13 18:12:43 -08:00
parent 6ac73c8c13
commit 9a945edd87
13 changed files with 186 additions and 247 deletions
+18
View File
@@ -0,0 +1,18 @@
export function requireAuthentication(gssp) {
return async (context) => {
const { req, res } = context;
const token = req.cookies.userToken;
if (!token) {
// Redirect to login page
return {
redirect: {
destination: '/admin/login',
statusCode: 302
}
};
}
return await gssp(context); // Continue on to call `getServerSideProps` logic
}
}
+5
View File
@@ -0,0 +1,5 @@
class UserService {
}
export {}