Skip to content

Commit b58759a

Browse files
committed
make pw var available when user not found
1 parent 9389260 commit b58759a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

st2auth_flat_file_backend/flat_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def _load_file(self):
7474
self.entries[username] = hash_data
7575

7676
def check_password(self, username, password):
77+
encode_local = locale.getpreferredencoding()
78+
pw = bytes(password, encoding=encode_local)
7779
if username in self.entries:
7880
hash_data = self.entries[username]
79-
encode_local = locale.getpreferredencoding()
80-
pw = bytes(password, encoding=encode_local)
8181
if hash_data.startswith("$apr1$"):
8282
LOG.warning(
8383
"%s uses MD5 algorithm to hash the password."

0 commit comments

Comments
 (0)