chill_cheese
11/04/2022, 1:19 PMchill_cheese
11/04/2022, 1:19 PMnkshah2
11/04/2022, 1:23 PMnkshah2
11/04/2022, 1:24 PMchill_cheese
11/04/2022, 1:24 PMif (SuperTokens.canHandleRoute()) {
// This renders the login UI on the /login route
return SuperTokens.getRoutingComponent()
}
chill_cheese
11/04/2022, 1:24 PMnkshah2
11/04/2022, 1:25 PMnkshah2
11/04/2022, 1:25 PMchill_cheese
11/04/2022, 1:39 PMSuperTokens.canHandleRoute()
Becomes true?nkshah2
11/04/2022, 1:40 PMchill_cheese
11/04/2022, 1:51 PM{
appName: my-app',
apiDomain: 'http://localhost:80',
websiteDomain: 'http://localhost:3000',
apiBasePath: '/auth',
websiteBasePath: '/'
}
for websiteBasePath: '/'
I can see the login screen
but if I set websiteBasePath: '/login',
and access http://localhost:3000/login, then getting: Cannot GET /login
nkshah2
11/04/2022, 1:52 PMchill_cheese
11/04/2022, 1:52 PMnkshah2
11/04/2022, 1:53 PMnkshah2
11/04/2022, 1:53 PMchill_cheese
11/04/2022, 1:54 PMnkshah2
11/04/2022, 1:55 PMchill_cheese
11/04/2022, 1:56 PMimport React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import SuperTokens, { SuperTokensWrapper } from 'supertokens-auth-react';
import Passwordless from 'supertokens-auth-react/recipe/passwordless';
import Session from 'supertokens-auth-react/recipe/session';
SuperTokens.init({
appInfo: {
appName: 'my-app',
apiDomain: 'http://localhost:80',
websiteDomain: 'http://localhost:3000',
apiBasePath: '/auth',
websiteBasePath: '/',
},
recipeList: [
Passwordless.init({
contactMethod: 'EMAIL_OR_PHONE',
}),
Session.init(),
],
});
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
console.log('sup: ', SuperTokens.canHandleRoute());
if (SuperTokens.canHandleRoute()) {
// This renders the login UI on the /login route
root.render(SuperTokens.getRoutingComponent());
} else
root.render(
<React.StrictMode>
<SuperTokensWrapper>
<App />
</SuperTokensWrapper>
</React.StrictMode>
);
nkshah2
11/04/2022, 1:58 PMchill_cheese
11/04/2022, 1:58 PMnkshah2
11/04/2022, 1:59 PMchill_cheese
11/04/2022, 2:00 PMnkshah2
11/04/2022, 2:01 PMchill_cheese
11/04/2022, 2:15 PMnkshah2
11/04/2022, 2:22 PM