• a

    Ashish Pilania

    1 year ago
    import React from "react"; import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom"; import SuperTokens, { getSuperTokensRoutesForReactRouterDom, } from "supertokens-auth-react"; import ThirdPartyEmailPassword, { Google, } from "supertokens-auth-react/recipe/thirdpartyemailpassword"; import Session from "supertokens-auth-react/recipe/session"; SuperTokens.init({ appInfo: { // learn more about this on https://supertokens.io/docs/thirdpartyemailpassword/appinfo appName: "My Demo App", // Example: "SuperTokens", apiDomain: "http://localhost:3001", // Example: "https://api.supertokens.io", websiteDomain: "http://localhost:3000", // Example: "https://supertokens.io" }, recipeList: [ ThirdPartyEmailPassword.init({ signInAndUpFeature: { providers: [Google.init()], }, }), Session.init(), ], }); class Login extends React.Component { render() { return ( Router Switch {getSuperTokensRoutesForReactRouterDom(require("react-router-dom"))} /Switch /Router ); } } export default Login;
  • r

    rp

    1 year ago
    can you please edit the message to make it a code snippet?
  • r

    rp

    1 year ago
    will be easier to consume that way
  • a

    Ashish Pilania

    1 year ago
    SuperTokens.init({ appInfo: { appName: "My Demo App", apiDomain: "http://localhost:3001/", websiteDomain: "http://localhost:3000/", }, recipeList: [ ThirdPartyEmailPassword.init({ signInAndUpFeature: { providers: [Google.init()], }, }), Session.init(), ], }); class Login extends React.Component { render() { return ( BrowserRouter Switch {getSuperTokensRoutesForReactRouterDom(require("react-router-dom"))} /Switch /BrowserRouter ); } }
  • a

    Ashish Pilania

    1 year ago
    is it ok
  • a

    Ashish Pilania

    1 year ago
    I had tried this code in my react but its not working plus where will i put my supertoken server url
  • r

    rp

    1 year ago
  • r

    rp

    1 year ago
    And you need to put that on your node process on the backend.
  • r

    rp

    1 year ago
    the whole setup requires a frontend and a backend setup.
  • r

    rp

    1 year ago