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: logins_controller.rb
    path of file: ./repos/workarea/storefront/app/controllers/workarea/storefront/users
    
    the code of the file until where you have to start completion: module Workarea
  class Storefront::Users::LoginsController 
    
    def create
      if invalid_recaptcha?(action: 'login')
        challenge_recaptcha!
        @user = User.new
        render 'new', status: 422
      elsif user = User.find_for_login(params[:email], params[:password])
        login(user)

        login_service = Login.new(user, current_order).tap(&:perform)
        self.current_order = login_service.current_order

        flash[:success] = t('workarea.storefront.flash_messages.logged_in')
        redirect_back_or users_dashboard_path
      else
        flash[:error] = t('workarea.storefront.flash_messages.login_failure')
        @user = User.new
        render 'new', status: 422
      end