mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-23 07:04:27 +01:00
Handle edge case where users have a null password (#1902)
* Handle an edge case where users try to login but were logged in through an authentication provider
This commit is contained in:
@@ -366,6 +366,13 @@ def login():
|
||||
user = Users.query.filter_by(name=name).first()
|
||||
|
||||
if user:
|
||||
if user.password is None:
|
||||
errors.append(
|
||||
"Your account was registered with a 3rd party authentication provider. "
|
||||
"Please try logging in with a configured authentication provider."
|
||||
)
|
||||
return render_template("login.html", errors=errors)
|
||||
|
||||
if user and verify_password(request.form["password"], user.password):
|
||||
session.regenerate()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user