create confirmed account with social login

This commit is contained in:
deflax 2024-04-07 23:05:24 +03:00
parent 6ff2a7957f
commit 683fc644c8

View file

@ -34,7 +34,6 @@ def unconfirmed():
@auth.route('/register', methods=['GET', 'POST']) @auth.route('/register', methods=['GET', 'POST'])
def register(): def register():
#print(current_app.secret_key)
page = { 'title': 'Register' } page = { 'title': 'Register' }
form = RegistrationForm() form = RegistrationForm()
if form.validate_on_submit(): if form.validate_on_submit():
@ -157,7 +156,7 @@ def oauth2_callback(provider):
user = db.session.scalar(db.select(User).where(User.email == email)) user = db.session.scalar(db.select(User).where(User.email == email))
if user is None: if user is None:
#user = User(email=email, username=email.split('@')[0]) #user = User(email=email, username=email.split('@')[0])
user = User(email=email) user = User(email=email, confirmed=True)
db.session.add(user) db.session.add(user)
db.session.commit() db.session.commit()