codingInMyBasement
codingInMyBasement

Reputation: 838

How to disable reCAPTCHA Flask App Builder

I am new to flask app builder and am trying to set up user registration but for my purposes, I do not need reCAPTCHA. Is there a way to disable reCaptcha in the config file? Here is what my config file looks like below:

# Uncomment to setup Public role name, no authentication needed
# AUTH_ROLE_PUBLIC = 'Public'

# Will allow user self registration
AUTH_USER_REGISTRATION = True

# Config for Flask-WTF Recaptcha necessary for user registration
RECAPTCHA_PUBLIC_KEY = 'GOOGLE PUBLIC KEY FOR RECAPTCHA'
RECAPTCHA_PRIVATE_KEY = 'GOOGLE PRIVATE KEY FOR RECAPTCHA'
# Config for Flask-Mail necessary for user registration
MAIL_SERVER = 'smtp.gmail.com'
MAIL_USE_TLS = True
MAIL_USERNAME = '[email protected]'
MAIL_PASSWORD = 'passwordformail'
MAIL_DEFAULT_SENDER = '[email protected]'


# The default user self registration role
AUTH_USER_REGISTRATION_ROLE = "Public"

Upvotes: 3

Views: 1002

Answers (1)

Keegan Murphy
Keegan Murphy

Reputation: 832

To disable the recaptcha feature and bypass validation, you will need to set RECAPTCHA_ENABLED = False

RECAPTCHA_ENABLED: Bool - True by default, when False it will bypass validation

Future calls to recaptcha.verify() in your flask server file will return True by default as a result.

To disable and hide the recaptcha in the HTML template code, simply omit any code with {{ recaptcha }} in your form.

Found from the documentation here: https://github.com/mardix/flask-recaptcha

Upvotes: 1

Related Questions