{this.state.websiteBasePath || "/"}
.
+ You can view the login UI by visiting {this.state.websiteBasePath || "/"}
. You can also see all designs of our pre built UI, for each page on this link.
)
diff --git a/v2/src/plugins/codeTypeChecking/jsEnv/package.json b/v2/src/plugins/codeTypeChecking/jsEnv/package.json
index 8fb27cc14..6f4760c7d 100644
--- a/v2/src/plugins/codeTypeChecking/jsEnv/package.json
+++ b/v2/src/plugins/codeTypeChecking/jsEnv/package.json
@@ -55,14 +55,14 @@
"react-router-dom5": "npm:react-router-dom@^5.3.0",
"socket.io": "^4.6.1",
"socketio": "^1.0.0",
- "supertokens-auth-react": "^0.37.0",
- "supertokens-node": "^16.7.0",
+ "supertokens-auth-react": "github:supertokens/supertokens-auth-react#0.39",
+ "supertokens-node": "github:supertokens/supertokens-node#17.0",
"supertokens-node7": "npm:supertokens-node@7.3",
"supertokens-react-native": "^4.0.0",
- "supertokens-web-js": "^0.9.0",
- "supertokens-web-js-script": "github:supertokens/supertokens-web-js#0.9",
- "supertokens-website": "^18.0.0",
- "supertokens-website-script": "github:supertokens/supertokens-website#18.0",
+ "supertokens-web-js": "github:supertokens/supertokens-web-js#0.10",
+ "supertokens-web-js-script": "github:supertokens/supertokens-web-js#0.10",
+ "supertokens-website": "^17.0.0",
+ "supertokens-website-script": "github:supertokens/supertokens-website#17.0",
"typescript": "^4.9.5"
}
-}
+}
\ No newline at end of file
diff --git a/v2/src/plugins/markdownVariables.json b/v2/src/plugins/markdownVariables.json
index 13dc5220f..74609122a 100644
--- a/v2/src/plugins/markdownVariables.json
+++ b/v2/src/plugins/markdownVariables.json
@@ -84,6 +84,7 @@
"goSignIn": "EmailPasswordSignIn",
"pythonSignIn": "emailpassword_sign_in",
"nodeSignIn": "emailPasswordSignIn",
+ "nodeVerifyCredentials": "emailPasswordVerifyCredentials",
"nodeRecipeInitDefault": "// typecheck-only, removed from output",
"goRecipeInitDefault": "",
"pythonDefaultCallbackDefs": "",
@@ -231,6 +232,7 @@
"goSignIn": "SignIn",
"pythonSignIn": "sign_in",
"nodeSignIn": "signIn",
+ "nodeVerifyCredentials": "verifyCredentials",
"nodeRecipeInitDefault": "",
"goRecipeInitDefault": "",
"pythonDefaultCallbackDefs": "",
diff --git a/v2/thirdparty/advanced-customizations/frontend-hooks/handle-event.mdx b/v2/thirdparty/advanced-customizations/frontend-hooks/handle-event.mdx
index 9aec0a58b..45ba3aab1 100644
--- a/v2/thirdparty/advanced-customizations/frontend-hooks/handle-event.mdx
+++ b/v2/thirdparty/advanced-customizations/frontend-hooks/handle-event.mdx
@@ -23,11 +23,15 @@ ThirdParty.init({
// called when a user visits the login / sign up page with a valid session
// in this case, they are usually redirected to the main app
} else if (context.action === "SUCCESS") {
- let user = context.user;
- if (context.isNewRecipeUser && context.user.loginMethods.length === 1) {
- // sign up success
+ if (context.createdNewSession) {
+ let user = context.user;
+ if (context.isNewRecipeUser && context.user.loginMethods.length === 1) {
+ // sign up success
+ } else {
+ // sign in success
+ }
} else {
- // sign in success
+ // this is during linking a social account to an existing account
}
}
}
diff --git a/v2/thirdparty/advanced-customizations/frontend-hooks/redirection-callback.mdx b/v2/thirdparty/advanced-customizations/frontend-hooks/redirection-callback.mdx
index a96515fdf..09398a627 100644
--- a/v2/thirdparty/advanced-customizations/frontend-hooks/redirection-callback.mdx
+++ b/v2/thirdparty/advanced-customizations/frontend-hooks/redirection-callback.mdx
@@ -16,17 +16,23 @@ This function is used to change where the user is redirected to post certain act
```tsx
import ThirdParty from "supertokens-auth-react/recipe/thirdparty";
+import SuperTokens from "supertokens-auth-react"
-ThirdParty.init({
+SuperTokens.init({
+ appInfo: {
+ appName: "SuperTokens",
+ apiDomain: "http://localhost:3000",
+ websiteDomain: "http://localhost:3000",
+ },
getRedirectionURL: async (context) => {
- if (context.action === "SUCCESS") {
+ if (context.action === "SUCCESS" && context.newSessionCreated) {
// called on a successful sign in / up. Where should the user go next?
let redirectToPath = context.redirectToPath;
if (redirectToPath !== undefined) {
// we are navigating back to where the user was before they authenticated
return redirectToPath;
}
- if (context.isNewPrimaryUser) {
+ if (context.createdNewUser) {
// user signed up
return "/onboarding"
} else {
@@ -36,8 +42,11 @@ ThirdParty.init({
}
// return undefined to let the default behaviour play out
return undefined;
- }
-});
+ },
+ recipeList: [
+ ThirdParty.init(/* ... */)
+ ]
+})
```
diff --git a/v2/thirdparty/advanced-customizations/user-context.mdx b/v2/thirdparty/advanced-customizations/user-context.mdx
index a9f68e800..a8e820728 100644
--- a/v2/thirdparty/advanced-customizations/user-context.mdx
+++ b/v2/thirdparty/advanced-customizations/user-context.mdx
@@ -57,7 +57,7 @@ SuperTokens.init({
signInUp: async function (input) {
let resp = await originalImplementation.signInUp(input);
if (resp.status === "OK" && resp.createdNewRecipeUser &&
- resp.user.loginMethods.length === 1) {
+ resp.user.loginMethods.length === 1 && input.session === undefined) {
/*
* This is called during the signInUp API for third party login,
* but before calling the createNewSession function.
diff --git a/v2/thirdparty/common-customizations/account-linking/adding-accounts-to-session.mdx b/v2/thirdparty/common-customizations/account-linking/adding-accounts-to-session.mdx
new file mode 100644
index 000000000..b8b928c10
--- /dev/null
+++ b/v2/thirdparty/common-customizations/account-linking/adding-accounts-to-session.mdx
@@ -0,0 +1,344 @@
+---
+id: adding-accounts-to-session
+title: Linking social accounts or adding a password to an existing account
+hide_title: true
+---
+
+import AccountLinkingPaidBanner from '../../../community/reusableMD/accountlinking/AccountLinkingPaidBanner.mdx'
+import BackendSDKTabs from "/src/components/tabs/BackendSDKTabs";
+
+