You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: calendars_controller.rb
    path of file: ./repos/miru-web/app/controllers/internal_api/v1
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class InternalApi::V1::CalendarsControl
    
  def callback
    authorize :callback, policy_class: CalendarPolicy

    authorization_code = params[:code]

    if authorization_code.present?
      @client.code = authorization_code

      response = @client.fetch_access_token!
      session[:authorization] = response

      redirect_to internal_api_v1_calendars_path
    else
      current_user.update!(calendar_connected: false)
    end