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: legacy_controller.rb
    path of file: ./repos/plots2/app/controllers
    
    the code of the file until where you have to start completion: class LegacyController
    
  def openid_username
    if params[:provider]
      # if with the open id through provider
      redirect_to URI.parse('/openid/' + params[:username] + '/' + params[:provider]).path, status: 301
    else
      # login without provider with openid
      redirect_to URI.parse('/openid/' + params[:username]).path, status: 301
    end