mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 23:17:12 +01:00
Replace next-auth with better-auth, adding magic link email login as the primary auth method and GitHub OAuth as an optional social provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
448 B
TypeScript
21 lines
448 B
TypeScript
import Auth from '../components/auth'
|
|
|
|
// This is the HOC
|
|
function withAuth(WrappedComponent: React.FunctionComponent) {
|
|
// Return a new component
|
|
function withAuth(pageProps) {
|
|
// Render the WrappedComponent with additional props
|
|
return (
|
|
<Auth>
|
|
<WrappedComponent {...pageProps} />
|
|
</Auth>
|
|
)
|
|
}
|
|
|
|
withAuth.displayName = `withAuth(${WrappedComponent.displayName}`
|
|
|
|
return withAuth
|
|
}
|
|
|
|
export default withAuth
|