Skip to content

Commit 63b3311

Browse files
Johan BookJohan Book
Johan Book
authored and
Johan Book
committed
fix(auth-ui): accomodate breaking changes
1 parent de07937 commit 63b3311

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

services/auth-ui/src/Router.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import React from "react";
1+
import { ReactElement } from "react";
22

3-
import SuperTokens from "supertokens-auth-react";
3+
import { EmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/emailpassword/prebuiltui";
4+
import { canHandleRoute, getRoutingComponent } from "supertokens-auth-react/ui";
45

5-
export function Router(): React.ReactElement {
6-
if (!SuperTokens.canHandleRoute()) {
6+
export function Router(): ReactElement {
7+
if (canHandleRoute([EmailPasswordPreBuiltUI])) {
78
return <p>An unexpected error has occurred: Unable to handle route</p>;
89
}
910

10-
const component = SuperTokens.getRoutingComponent();
11+
const component = getRoutingComponent([EmailPasswordPreBuiltUI]);
1112

1213
if (!component) {
1314
return <p>An unexpected error has occurred: Component not found</p>;

0 commit comments

Comments
 (0)