- Install supertokens-auth-react, supertokens-node, supertokens-web-js - Create frontend and backend SuperTokens configuration - Add API route handler for auth endpoints - Add SuperTokensProvider wrapper in root layout - Create new auth component with SuperTokens UI - Configure Google and GitHub OAuth providers - Ready for SuperTokens core deployment Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
707 B
TypeScript
31 lines
707 B
TypeScript
import ThirdPartyEmailPassword, {
|
|
Google,
|
|
Github,
|
|
} from "supertokens-auth-react/recipe/thirdpartyemailpassword";
|
|
import Session from "supertokens-auth-react/recipe/session";
|
|
|
|
export const frontendConfig = () => {
|
|
const appUrl = process.env.NEXT_PUBLIC_APP_URL || "https://app.vibnai.com";
|
|
|
|
return {
|
|
appInfo: {
|
|
appName: "Vib'n",
|
|
apiDomain: appUrl,
|
|
websiteDomain: appUrl,
|
|
apiBasePath: "/api/auth",
|
|
websiteBasePath: "/auth",
|
|
},
|
|
recipeList: [
|
|
ThirdPartyEmailPassword.init({
|
|
signInAndUpFeature: {
|
|
providers: [
|
|
Google.init(),
|
|
Github.init(),
|
|
],
|
|
},
|
|
}),
|
|
Session.init(),
|
|
],
|
|
};
|
|
};
|