-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathApp.tsx
More file actions
48 lines (43 loc) · 1.45 KB
/
App.tsx
File metadata and controls
48 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import * as reactRouter from "react-router";
import { Route, Routes } from "react-router";
import SuperTokens, { SuperTokensWrapper } from "supertokens-auth-react";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";
import { EmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/emailpassword/prebuiltui";
import Session from "supertokens-auth-react/recipe/session";
import ThirdParty from "supertokens-auth-react/recipe/thirdparty";
import { ThirdPartyPreBuiltUI } from "supertokens-auth-react/recipe/thirdparty/prebuiltui";
import { getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react/ui";
import { Index } from "@/routes/index";
function App() {
SuperTokens.init({
appInfo: {
appName: "ucmacm-website",
apiDomain: import.meta.env.VITE_API_DOMAIN,
websiteDomain: import.meta.env.VITE_WEBSITE_DOMAIN,
apiBasePath: "/auth",
websiteBasePath: "/auth",
},
recipeList: [
EmailPassword.init(),
ThirdParty.init({
signInAndUpFeature: {
providers: [ThirdParty.Google.init()],
},
}),
Session.init(),
],
disableAuthRoute: true,
});
return (
<SuperTokensWrapper>
<Routes>
{getSuperTokensRoutesForReactRouterDom(reactRouter, [
ThirdPartyPreBuiltUI,
EmailPasswordPreBuiltUI,
])}
<Route path="/" element={<Index />} />
</Routes>
</SuperTokensWrapper>
);
}
export default App;