Organize directories
This commit is contained in:
parent
8a91c9b89b
commit
4898382f78
433 changed files with 0 additions and 0 deletions
21
apps/link/lib/checkAuth.ts
Normal file
21
apps/link/lib/checkAuth.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { GetServerSideProps, GetServerSidePropsContext } from "next";
|
||||
import { getSession } from "next-auth/react";
|
||||
|
||||
export const checkAuth: GetServerSideProps = async (
|
||||
context: GetServerSidePropsContext
|
||||
) => {
|
||||
const session = await getSession(context);
|
||||
|
||||
if (!session) {
|
||||
return {
|
||||
redirect: {
|
||||
destination: "/login",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
props: { session },
|
||||
};
|
||||
};
|
||||
5
apps/link/lib/createEmotionCache.ts
Normal file
5
apps/link/lib/createEmotionCache.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import createCache from "@emotion/cache";
|
||||
|
||||
export default function createEmotionCache() {
|
||||
return createCache({ key: "css" });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue