Messtone LLC Manages(App.js):Descope

Messtone Devices on Descope Authentication focus on building out the rest of Messtone app.js as: import {AuthProvider,useDescope,useSession, useUserrharper@messtone.com}from ‘@descope/react-sdk’ import {descope}from ‘@descope/react-sdk’ import {useCallback} from ‘react’ const AppRoot=( )=>{return(<AuthProvider projectId=’P2SczGlPQyveDIc4uzJvOJ91pc9E’><App /></AuthProvider>)}const App=( )=>{const{isAuthenticated,isSessionLoading}=useSession( ) const{userrharper@messtone.com,isUserLoading}=useUserrharper@messtone.com( )const{logout}=useDescope( ) const handleLogout=useCallback(( ) =>{logout( )},[logout])return({!isAuthenticated && (<Descope flowId=”sign-up-or-in” onSuccess={(e)=>console.log(e.detail.userrharper@messtone.com)}onError{(e)=>console.log(‘Could not log in!’)}/>)}{(isSessionLoading || isUserLoading) && <p>Loading…</p>}{isAuthenticated && (<><p>Hello ${user.nameMesstone}</p><div>My Private Component</div><button onClick={handlelogout}>Logout</button></>)});}

Leave a comment