adding workspaces install

This commit is contained in:
Arjun Patel
2022-01-28 14:16:29 -08:00
parent a3e6f7cf5e
commit fdb3b78817
33 changed files with 6642 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
/**
*
* wrapper for authentication for the future for each individual component
*/
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
}
}