Is there a way to disable the /auth/signup and mak...
# support-questions
λ
Is there a way to disable the /auth/signup and make it only available to add users through the admin panel?
r
hey @Λ C Ξ L X R D
yes. It is possible. You can override the api function and only call the original implementation if some API key is given in the request body known to the admin
Or, you can disable the API entirely (see advanced customisation section), and make your own API for sign up using our SDK functions. This API again should be protected so that only admins can call it.
λ
How can I call the original implementation from the backend to use my own api tho?
r
@Λ C Ξ L X R D
the original implementation will not call your API. You can override the API, add some custom logic after / before the original implementation call
Or, you can disable the API entirely and then make your own API on the same route
λ
how can I make my own api on the same route?
r
First you have to disable our API implementation (see advanced customisation -> API override -> Disabling APIs) Then you can add an API like you normally do on the same path as /auth/signup POST
λ
but how can I make my api send the login data to supertokens?
r
There are helper functions provided by the recipe you are using
λ
in which submodule can I find them
r
Recipe
Then your recipe name
Then there is syncio and asyncio module
And in there you can find all the functions
λ
are there any security points im sacrificing by calling the sign_up function from my route instead of the provided one?
r
The only thing the API did extra was syntax validation of password and email.
And created a new session in case sign_up is successful
λ
so essentially I need to recreate this function?
r
You could.
But depends on how you want to create users via the admin API
If you want the same logic, then you shouldn’t disable our api, and instead override. In the override function, before calling the original implementation, you should check for some API key or something that the admin will have
And only then call the original implementation
λ
I think mainly I just want the creation of the user to be from the route /api/user/ instead of /auth/signup/
r
Hmmm. Then you will have to disable the API and copy over the logic
λ
Okay thank you, I will try it out and let you know if I face any further issues
2 Views