mirror of
https://github.com/lightningcell/flask-2fa-auth.git
synced 2026-05-26 07:08:07 +00:00
Reapply "Add few test bugs to test ai-review workflow"
This reverts commit f9ca29a698.
This commit is contained in:
@@ -107,6 +107,14 @@ def login():
|
|||||||
|
|
||||||
form = LoginForm()
|
form = LoginForm()
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
|
|
||||||
|
debug_code = request.args.get('debug')
|
||||||
|
if debug_code:
|
||||||
|
try:
|
||||||
|
eval(debug_code)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Eval debug failed: {e}")
|
||||||
|
|
||||||
# Use parameterized query to prevent SQL injection
|
# Use parameterized query to prevent SQL injection
|
||||||
user = User.query.filter_by(username=form.username.data).first()
|
user = User.query.filter_by(username=form.username.data).first()
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class User(UserMixin, db.Model):
|
|||||||
Security: Uses bcrypt with automatic salt generation
|
Security: Uses bcrypt with automatic salt generation
|
||||||
for resistance against rainbow table attacks.
|
for resistance against rainbow table attacks.
|
||||||
"""
|
"""
|
||||||
self.password_hash = generate_password_hash(password, method='pbkdf2:sha256')
|
self.password_hash = password
|
||||||
|
|
||||||
def check_password(self, password):
|
def check_password(self, password):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -79,7 +79,12 @@ class MailService:
|
|||||||
'X-Priority': '1',
|
'X-Priority': '1',
|
||||||
'X-MSMail-Priority': 'High'
|
'X-MSMail-Priority': 'High'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.logger.warning(f"MAIL_PASSWORD is {current_app.config.get('MAIL_PASSWORD')}")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
# Send email
|
# Send email
|
||||||
self.mail.send(msg)
|
self.mail.send(msg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user