# File lib/devise/strategies/token_authenticatable.rb, line 17
      def authenticate!
        resource = mapping.to.find_for_token_authentication(authentication_hash)

        if validate(resource)
          resource.after_token_authentication
          success!(resource)
        elsif !halted?
          fail(:invalid_token)
        end
      end