Redmine 4.1.7
This commit is contained in:
parent
55458d3479
commit
3ca3c37487
103 changed files with 2426 additions and 431 deletions
|
@ -115,11 +115,13 @@ class Token < ActiveRecord::Base
|
|||
return nil unless action.present? && /\A[a-z0-9]+\z/i.match?(key)
|
||||
|
||||
token = Token.find_by(:action => action, :value => key)
|
||||
if token && (token.action == action) && (token.value == key) && token.user
|
||||
if validity_days.nil? || (token.created_on > validity_days.days.ago)
|
||||
token
|
||||
end
|
||||
end
|
||||
return unless token
|
||||
return unless token.action == action
|
||||
return unless ActiveSupport::SecurityUtils.secure_compare(token.value.to_s, key)
|
||||
return unless token.user
|
||||
return unless validity_days.nil? || (token.created_on > validity_days.days.ago)
|
||||
|
||||
token
|
||||
end
|
||||
|
||||
def self.generate_token_value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue