Sha256: fab9c7dca3bdc847041be4d21d1044bb47642c16740d96c73041fa81943aa755

Contents?: true

Size: 1.29 KB

Versions: 25

Compression:

Stored size: 1.29 KB

Contents

class UserRegistrationsController < Devise::RegistrationsController
  include SpreeBase
  helper :users, 'spree/base'

  ssl_required
  after_filter :associate_user, :only => :create
  before_filter :check_permissions, :only => [:edit, :update]
  skip_before_filter :require_no_authentication

  # GET /resource/sign_up
  def new
    super
  end

  # POST /resource/sign_up
  def create
    @user = build_resource(params[:user])
    logger.debug(@user)
    if resource.save
      set_flash_message(:notice, :signed_up)
      sign_in_and_redirect(:user, @user)
    else
      clean_up_passwords(resource)
      render_with_scope(:new)
    end
  end

  # GET /resource/edit
  def edit
    super
  end

  # PUT /resource
  def update
    super
  end

  # DELETE /resource
  def destroy
    super
  end

  # GET /resource/cancel
  # Forces the session data which is usually expired after sign
  # in to be expired now. This is useful if the user wants to
  # cancel oauth signing in/up in the middle of the process,
  # removing all OAuth session data.
  def cancel
    super
  end

  protected

  def check_permissions
    authorize!(:create, resource)
  end

  def associate_user
    return unless current_user and current_order
    current_order.associate_user!(current_user)
    session[:guest_token] = nil
  end

end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
apispree_auth-0.0.0 app/controllers/user_registrations_controller.rb
My-Commerce_auth-1.1.0 app/controllers/user_registrations_controller.rb
My-Commerce_auth-1.0.0 app/controllers/user_registrations_controller.rb
MyCommerceapi-1.0.0 auth/app/controllers/user_registrations_controller.rb
MyCommerce-0.0.3 auth/app/controllers/user_registrations_controller.rb
rfcommerce_auth-0.0.3 app/controllers/user_registrations_controller.rb
spree_auth-0.60.6 app/controllers/user_registrations_controller.rb
spree_auth-0.60.5 app/controllers/user_registrations_controller.rb
spree_auth-0.50.4 app/controllers/user_registrations_controller.rb
spree_auth-0.60.4 app/controllers/user_registrations_controller.rb
spree_auth-0.50.3 app/controllers/user_registrations_controller.rb
spree_auth-0.60.3 app/controllers/user_registrations_controller.rb
spree_auth-0.60.2 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.80.28 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.80.27 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.80.26 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.80.25 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.80.24 app/controllers/user_registrations_controller.rb
spree_bushido_auth-0.60.1 app/controllers/user_registrations_controller.rb
spree_auth-0.60.1 app/controllers/user_registrations_controller.rb