Last active
December 9, 2020 14:01
-
-
Save kant01ne/8db2515e976d6df962dcb6b7ff9db314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '../styles/globals.css'; | |
import React from "react"; | |
import 'regenerator-runtime/runtime'; | |
import SuperTokens from 'supertokens-auth-react'; | |
import EmailPassword from 'supertokens-auth-react/recipe/emailpassword'; | |
import Session from 'supertokens-auth-react/recipe/session'; | |
const websitePort = process.env.APP_PORT || 3000; | |
const websiteUrl = process.env.NEXT_PUBLIC_APP_URL || `http://localhost:${websitePort}`; | |
if (typeof window !== 'undefined') { | |
SuperTokens.init({ | |
appInfo: { | |
appName: "YOUR APP NAME", // Example: "SuperTokens Demo App" | |
apiDomain: websiteUrl, | |
websiteDomain: websiteUrl, | |
apiBasePath: "api/auth" | |
}, | |
recipeList: [ | |
EmailPassword.init(), | |
Session.init({ | |
sessionScope: 'localhost' | |
}) | |
] | |
}); | |
} | |
function MyApp({ Component, pageProps }) { | |
return <Component {...pageProps} />; | |
} | |
export default MyApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment