Skip to content

Commit

Permalink
fix: redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
gmat224 committed Dec 22, 2024
1 parent 3fb65a8 commit 3541926
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ SuperTokens.init({
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
let redirectionURL = "/";
let redirectionURL =import.meta.env.VITE_APP_URL + "/";
try {
const userMetadata = await getUserMetaData();
if (userMetadata.status === 200) {
if (userMetadata.data!.bIsUserInfoComplete === false) {
redirectionURL = "/signup/information";
redirectionURL = import.meta.env.VITE_APP_URL +"/signup/information";
} else if (
userMetadata.data!.bIsUserInfoComplete &&
userMetadata.data!.bIsMembershipPaymentComplete === false
) {
redirectionURL = "/membership";
redirectionURL =import.meta.env.VITE_APP_URL + "/membership";
} else {
redirectionURL = "/";
redirectionURL =import.meta.env.VITE_APP_URL + "/";
}
} else {
// Request Failed
Expand All @@ -88,7 +88,7 @@ SuperTokens.init({
}
return redirectionURL;
} else if (context.action === "TO_AUTH") {
return "/signup";
return import.meta.env.VITE_APP_URL + "/signup";
}
},
});
Expand Down

0 comments on commit 3541926

Please sign in to comment.