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: hook.rb
    path of file: ./repos/openproject/modules/openid_connect/lib/open_project/openid_connect/hooks
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-202
    
      def omniauth_user_authorized(context)
        auth_hash = context[:auth_hash]
        controller = context[:controller]

        # fetch the access token if it's present
        access_token = auth_hash.fetch(:credentials, {})[:token]
        # put it into a cookie
        if controller && access_token
          controller.send(:cookies)[:_open_project_session_access_token] = {
            value: access_token,
            secure: !!Rails.configuration.force_ssl
          }
        end