Skip to content

Commit

Permalink
Revert "debug info"
Browse files Browse the repository at this point in the history
This reverts commit 5058572.
  • Loading branch information
cs0511 committed Sep 6, 2021
1 parent 17333cf commit 95efe01
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,18 @@ def set_user_by_refresh_token(mapping = nil)
end

def update_auth_header
Rails.logger.error("update_auth_header resource: #{@resource&.uuid}, client: #{@token.client}, @token: #{@token}")
# cannot save object if model has invalid params
return unless @resource && @token.client

Rails.logger.error("update_auth_header(#{@resource&.uuid}) @used_auth_by_token #{@used_auth_by_token}")
# Generate new client with existing authentication
@token.client = nil unless @used_auth_by_token

if @used_auth_by_token && !DeviseTokenAuth.change_headers_on_each_request
# should not append auth header if @resource related token was
# cleared by sign out in the meantime
Rails.logger.error("update_auth_header(#{@resource&.uuid}) tokens #{@resource.reload.tokens}")
Rails.logger.error("fail to update_auth_header2(#{@resource&.uuid})") if @resource.reload.tokens[@token.client].nil?
return if @resource.reload.tokens[@token.client].nil?

@auth_header ||= @resource.build_auth_header(@token.token, @token.client, @token.refresh_token)
Rails.logger.error("update_auth_header(#{@resource&.uuid}) auth_header: #{@auth_header}")
# update the response header
response.headers.merge!(@auth_header)

Expand Down
1 change: 0 additions & 1 deletion app/controllers/devise_token_auth/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def create
return render_create_error_bad_credentials
end
@token = @resource.create_token
Rails.logger.error("create_session @token: #{@token}")
@resource.save

sign_in(:user, @resource, store: false, bypass: false)
Expand Down

0 comments on commit 95efe01

Please sign in to comment.