Skip to main content

If you are using our backend SDK that is lesser than the following versions, please visit the older documentation link here.

Disabling APIs

To disable the API entirely, all you need to do is override the api implementation as undefined.

For example, if you want to disable the consume code API, all you do is:

import SuperTokens from "supertokens-node";
import Passwordless from "supertokens-node/recipe/passwordless";
import ThirdParty from "supertokens-node/recipe/thirdparty";

SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [
ThirdParty.init({
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
signInUpPOST: undefined
}
}
}
}),
Passwordless.init({
contactMethod: "EMAIL", // This example will work with any contactMethod
flowType: "USER_INPUT_CODE_AND_MAGIC_LINK", // This example will work with any flow.
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
consumeCodePOST: undefined, // disable sign in & up with passwordless
}
}
}
})
]
});
important

You then need to define your own routes that will handle this API call. You can see the Frontend driver interface API spec here

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI