module Devise::Models::JiraAuthenticable::ClassMethods

Public Instance Methods

find_for_jira_authentication(authentication_hash) click to toggle source

Invoked by the JiraAuthenticatable strategy to perform the authentication against the JIRA server. The username is extracted from the authentication hash. We then search for an existing resource using the username. If no resource is found, a new resource is built (not created). If authentication is successful the callback is responsible for saving the resource. Returns the resource if authentication succeeds and nil if it does not.

# File lib/devise/models/jira_authenticable.rb, line 79
def find_for_jira_authentication(authentication_hash)
  username, password = authentication_hash[:username], authentication_hash[:password]

  resource = find_for_authentication( username: username )

  resource&.valid_jira_password?(password) ? resource : nil
end