mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-04-05 18:09:04 +00:00
Implement authentication using Passport.js
This commit is contained in:
16
pages/protected.tsx
Normal file
16
pages/protected.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import withPageAuthRequired from '@/config/auth/withPageAuthRequired';
|
||||
import { GetServerSideProps, NextPage } from 'next';
|
||||
|
||||
const protectedPage: NextPage<{
|
||||
username: string;
|
||||
}> = ({ username }) => {
|
||||
return (
|
||||
<div>
|
||||
<h1> Hello, {username}! </h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = withPageAuthRequired();
|
||||
|
||||
export default protectedPage;
|
||||
Reference in New Issue
Block a user