- 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>
19 lines
451 B
TypeScript
19 lines
451 B
TypeScript
"use client";
|
|
|
|
import React from "react";
|
|
import { useEffect } from "react";
|
|
import SuperTokensReact from "supertokens-auth-react";
|
|
import { frontendConfig } from "@/lib/supertokens/frontendConfig";
|
|
|
|
export const SuperTokensProvider: React.FC<React.PropsWithChildren<{}>> = ({
|
|
children,
|
|
}) => {
|
|
useEffect(() => {
|
|
if (typeof window !== "undefined") {
|
|
SuperTokensReact.init(frontendConfig());
|
|
}
|
|
}, []);
|
|
|
|
return <>{children}</>;
|
|
};
|