Skip to content

Commit

Permalink
MAM-Tim-patch (#200)
Browse files Browse the repository at this point in the history
* logging for JWT decode
  • Loading branch information
jtomchak authored Oct 31, 2023
1 parent 5afaa21 commit 0884b7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ def require_user!
def require_mammoth!
header = request.headers['Authorization']
header = header.split.last if header
unless header
Rails.logger.warn { "NO HEADER PROVIDED DECODE #{request}" }
render json: { error: 'This method requires an authenticated user' }, status: 422
end
@decoded = JsonToken.decode(header)
Rails.logger.info { "DECODE #{@decode}" }
@decoded
end

Expand Down

0 comments on commit 0884b7d

Please sign in to comment.