123456789101112131415161718192021 |
- module Auth::Internal
- def self.check(username, password, _config, user)
-
- return false if !username
- return false if !user
-
- if user.password =~ /^\{sha2\}/
- crypted = Digest::SHA2.hexdigest(password)
- return user if user.password == "{sha2}#{crypted}"
- end
-
- return user if user.password == password
- false
- end
- end
|