diff --git a/auth-mastodon.py b/auth-mastodon.py index 0849a64..efc9714 100644 --- a/auth-mastodon.py +++ b/auth-mastodon.py @@ -21,7 +21,15 @@ db_name = "mastodon" # This is the query that pulls the password hash for the given user. Mastodon doesn't store the domain for local accounts in # the database, so we ignore the host component and try to match username where the domain is NULL. -db_query_getpass = "select users.encrypted_password as password from accounts inner join users on accounts.id=users.account_id where lower(accounts.username) = %(user)s and accounts.domain is null" +db_query_getpass = """ + SELECT users.encrypted_password AS password + FROM accounts + INNER JOIN users + ON accounts.id = users.account_id + WHERE + lower(accounts.username) = %(user)s + AND accounts.domain IS NULL + """ ######################################################################## # Setup