mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
more work on auth
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
import { SessionProvider } from 'next-auth/react'
|
||||
import Auth from '../components/auth'
|
||||
import User from '../components/user'
|
||||
|
||||
// This is the HOC
|
||||
function withAuth(WrappedComponent) {
|
||||
function withAuth(WrappedComponent: React.FunctionComponent) {
|
||||
// Return a new component
|
||||
function withAuth({ session, ...pageProps }) {
|
||||
// Render the WrappedComponent with additional props
|
||||
return (
|
||||
<SessionProvider session={session}>
|
||||
<Auth>
|
||||
<User />
|
||||
<WrappedComponent {...pageProps} />
|
||||
</Auth>
|
||||
</SessionProvider>
|
||||
|
||||
Reference in New Issue
Block a user