joesim_
nicolasfry
kojydesu
Erick
robschilder
ℹ Starting the development server... Docusaurus website is running at "http://localhost:3000/". Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating ● Client █████████████████████████ building (10%) 0/5 entries 1/5 dependencies 0/0 modules 0 ac tive ℹ 「wds」: Project is running at http://0.0.0.0:3000/ ℹ 「wds」: webpack output is served from / ℹ 「wds」: Content not from webpack is served from /Users/rs/Documents/Development/docs/v2 ℹ 「wds」: 404s will fallback to /index.html node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10)
git clone https://github.com/supertokens/docs.git
git checkout 0.9.0
cd v2
npm i -d
Kvist
trivialkettle
kiesker
import { SuperTokensConfig, PreBuiltUIList } from './database/auth/supertoken'; import SuperTokens, { SuperTokensWrapper } from "supertokens-auth-react"; import { Routes, BrowserRouter as Router, Route } from "react-router-dom"; import { getSuperTokensRoutesForReactRouterDom } from 'supertokens-auth-react/ui' import { SessionAuth, SessionContext } from "supertokens-auth-react/recipe/session" //Components import Navbar from './components/nav/Navbar'; import NavbarAuth from './components/nav/NavbarAuth'; //Free Routes import Home from './routes/free/Home'; //Protected User Routes import Profile from './routes/user/Profile'; //Protecte Admin Routes SuperTokens.init(SuperTokensConfig); function App() { //Here const check = SessionContext; return ( <SuperTokensWrapper> <div className='App app-container'> <Router> {check ? <Navbar /> : <NavbarAuth />} <Routes> {/* This shows the login UI on "/auth" route */} {getSuperTokensRoutesForReactRouterDom(require("react-router-dom"), PreBuiltUIList)} {/* Unprotected route */} <Route path="/" element={<Home />} /> {/* Unprotected route */} {/* Protected route Users */} <Route path="/profile" element={ /* This protects the "/" route so that it shows <Home /> only if the user is logged in. Else it redirects the user to "/auth" */ <SessionAuth> <Profile /> </SessionAuth> } /> {/* Protected route Users */} </Routes> </Router> </div> </SuperTokensWrapper> ); } export default App;
monster71554
shri4953
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).