I have this extension used in my project: https://pythonhosted.org/Flask-User/index.html
I also have a REST API and a register() function there which accepts JSON-object and should be able to create a new user.
How can I achieve this with Flask-user API?
UPDATE: I have a fully created User model. Basically I need some kind of User() constructor provided from Flask-user where I can pass the input from JSON-object.
Why do I need it: Flask-user extension has its own way of working. For example, it sends e-mails to confirm an account, hashes password in its own way.
The short answer is no, there is no built-in way to perform the registration the same way that Flask-User's register
view does. You'll have to do everything that view does when handling a POST request. The basics are:
user_manager.hash_password(secret)
to create a hashed password, and set this on the user._send_registered_email(user, email, True)
to send the confirmation email.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With