X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c694c78c9a9fbc46f71519546cddc15f70835d20..c8e21c409c9bec446f0caa2526d5b07861bb3299:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 65c70d2c7..7e1f1c6d6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -44,6 +44,7 @@ # class User < ApplicationRecord + require "digest" require "xml/libxml" has_many :traces, -> { where(:visible => true) } @@ -306,6 +307,13 @@ class User < ApplicationRecord ClientApplication.find_by(:key => application_key).access_token_for_user(self) end + def fingerprint + digest = Digest::SHA256.new + digest.update(email) + digest.update(pass_crypt) + digest.hexdigest + end + private def set_defaults