mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-23 00:25:18 +00:00
Prompt for password when invalid password is entered
This commit is contained in:
parent
ef72cb70cd
commit
6221fe9c00
@ -186,7 +186,7 @@ def authenticate(optional=False):
|
|||||||
if not simplepam.authenticate(user, passwd, "sshd"):
|
if not simplepam.authenticate(user, passwd, "sshd"):
|
||||||
logger.critical(u"Basic authentication failed for user %s from %s",
|
logger.critical(u"Basic authentication failed for user %s from %s",
|
||||||
repr(user), req.context.get("remote_addr"))
|
repr(user), req.context.get("remote_addr"))
|
||||||
raise falcon.HTTPForbidden("Forbidden", "Invalid password")
|
raise falcon.HTTPUnauthorized("Forbidden", "Invalid password", ("Basic",))
|
||||||
|
|
||||||
req.context["user"] = User.objects.get(user)
|
req.context["user"] = User.objects.get(user)
|
||||||
return func(resource, req, resp, *args, **kwargs)
|
return func(resource, req, resp, *args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user