Updated

app/controllers/api/v1 / internal_controller.rb

A
19 lines of codes
1 methods
12.3 complexity/method
7 churn
12.29 complexity
0 duplications
class Api::V1::InternalController < ActionController::API
  1. Api::V1::InternalController assumes too much for instance variable '@current_user'
  2. Api::V1::InternalController has no descriptive comment
include Pagy::Backend include Api::Concerns::RequestExceptionHandler before_action :authenticate_user around_action :handle_with_exception, unless: :devise_controller? def authenticate_user
  1. Api::V1::InternalController#authenticate_user has approx 6 statements
header = request.headers['Authorization'] header = header.split(' ').last if header begin decoded = Users::JsonWebToken.decode_user(header) @current_user = decoded[:ok] @current_account = @current_user.account rescue render json: { errors: 'Unauthorized' }, status: :unauthorized end end end