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: session_controller.rb
    path of file: ./repos/locale_ninja/app/controllers/locale_ninja
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module LocaleNinja
  class SessionController < ApplicationController
    skip_before_action :authenticate!, only: %i[login logout]

    CLIENT_ID = Rails.application.credentials.github.client_id
    CLIENT_SECRET = Rails.application.credentials.github.client_secret

    private_constant :CLIENT_ID
    private_constant :CLIENT_SECRET

    def login
      code = params['code']
      response = ::HT
    
    def login
      code = params['code']
      response = ::HTTParty.post('https://github.com/login/oauth/access_token',
                                 body: {
                                   client_id: CLIENT_ID,
                                   client_secret: CLIENT_SECRET,
                                   code:
                                 }
                                )
      parsed = CGI.parse(response)
      session[:access_token] = parsed['access_token'].first
      user = GithubApiService.new(access_token:).user
      session[:user] = user.to_h.slice(:avatar_url, :id, :login)
      redirect_to(root_path)
    end