Skip to content

Instantly share code, notes, and snippets.

@kant01ne
Last active December 9, 2020 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kant01ne/8db2515e976d6df962dcb6b7ff9db314 to your computer and use it in GitHub Desktop.
Save kant01ne/8db2515e976d6df962dcb6b7ff9db314 to your computer and use it in GitHub Desktop.
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