-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getInitialProps from _app are lost when using withPasswordProtect() #59
Comments
+1 |
jaiew
added a commit
to jaiew/next-password-protect
that referenced
this issue
Jan 9, 2023
jaiew
added a commit
to jaiew/next-password-protect
that referenced
this issue
Jan 9, 2023
jaiew
added a commit
to jaiew/next-password-protect
that referenced
this issue
Jan 9, 2023
You should be able to attach import { withPasswordProtect } from "next-password-protect";
// Before: export default App;
const ProtectedApp = process.env.PASSWORD_PROTECT
? withPasswordProtect(App, {
// Options go here (optional)
loginApiUrl: "/login",
})
: App;
// Set getInitialProps on HOC instance
ProtectedApp.getInitialProps = () => {
//
};
export default ProtectedApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Any props set within custom _app component are lost when exporting withPasswordProtect()
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
Props from _app shouldn't be overwritten or lost.
Stack
Node fermium, Next 12, next-password-protect 1.7
The text was updated successfully, but these errors were encountered: