Disabling APIs
To disable an API entirely, all you need to do is override the api implementation with undefined
.
For example, if you want to disable the sign-up / sign-in api from this recipe, all you do is this:
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
import EmailPassword from "supertokens-node/recipe/emailpassword";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
EmailPassword.init({
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
signInPOST: undefined, // disable sign in with email & password
signUpPOST: undefined, // disable sign up with email & password
}
}
}
}),
ThirdParty.init({
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
signInUpPOST: undefined // disable sign in & up with third party
}
}
}
})
]
});
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