I am making an app in the flask using firebase authentication
with the pyrebase
library.
following is the code I use for authentication…
@app.route('/register', methods=['GET', 'POST']) def register_page(): form = RegisterForm() if form.validate_on_submit(): data = { "username": form.username.data, "email_address": form.email_address.data, "password_hash": form.password.data } db.collection('users').document(form.username.data).set(data) def register(): email = form.email_address.data password = form.password.data confirm_pass = form.confirm_password.data if password == confirm_pass: sign_in = auth.create_user_with_email_and_password(email, password) auth.send_email_verification(sign_in['idToken']) # for email verification print("email verification sent") register() return redirect(url_for('market_page')) if form.errors != {}: # if no errors occur from validators for err_msg in form.errors.values(): print(f'there was an error creating the user {err_msg}') return render_template('register.html', form=form)
I read most of the firebase documentation but I wasn’t able to find any answer.
Answer
It looks like there is an emailVerified
in the result from calling the get_account_info
function.
I find it easiest to find this type of information by look at the Pyrebase auth implementation and then finding the Google documentation for the REST API that is invoked, which is getAccountInfo
here.