mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-24 19:24:13 +01:00
login: fix login for legacy accounts (#590)
This commit is contained in:
parent
2df3dc280c
commit
108d4b86d9
@ -60,12 +60,13 @@ def verify_hash(password, passhash):
|
|||||||
return pwd_context.verify(password, passhash)
|
return pwd_context.verify(password, passhash)
|
||||||
return False # No password given!
|
return False # No password given!
|
||||||
|
|
||||||
def _irc_try_login(irc, source, username):
|
def _irc_try_login(irc, source, username, skip_checks=False):
|
||||||
"""Internal function to process logins via IRC."""
|
"""Internal function to process logins via IRC."""
|
||||||
if irc.is_internal_client(source):
|
if irc.is_internal_client(source):
|
||||||
irc.error("Cannot use 'identify' via a command proxy.")
|
irc.error("Cannot use 'identify' via a command proxy.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not skip_checks:
|
||||||
logindata = _get_account(username)
|
logindata = _get_account(username)
|
||||||
|
|
||||||
network_filter = logindata.get('networks')
|
network_filter = logindata.get('networks')
|
||||||
@ -113,7 +114,7 @@ def identify(irc, source, args):
|
|||||||
# Process legacy logins (login:user).
|
# Process legacy logins (login:user).
|
||||||
if username.lower() == conf.conf['login'].get('user', '').lower() and password == conf.conf['login'].get('password'):
|
if username.lower() == conf.conf['login'].get('user', '').lower() and password == conf.conf['login'].get('password'):
|
||||||
realuser = conf.conf['login']['user']
|
realuser = conf.conf['login']['user']
|
||||||
_irc_try_login(irc, source, realuser)
|
_irc_try_login(irc, source, realuser, skip_checks=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Username not found or password incorrect.
|
# Username not found or password incorrect.
|
||||||
|
Loading…
Reference in New Issue
Block a user