Sha256: aa8aea4125865e364f684f1bb9473995eed20f9b6fbc6e18ccd6133c7d1f6bd6

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

class Ishapi::Users::RegistrationsController < Devise::RegistrationsController
  skip_before_action :verify_authenticity_token

  def create
    build_resource(sign_up_params)
    resource.save
    resource.profile = Ish::UserProfile.create({ user: resource, email: resource.email })
    yield resource if block_given?
    if resource.persisted?
      render json: {
        status: :ok,
        message: "You have successfully registered! Please verify your email by clicking on a link we just sent you, before logging in.",
      }, status: 200

      # if resource.active_for_authentication?
      #   set_flash_message! :notice, :signed_up
      #   sign_up(resource_name, resource)
      #   respond_with resource, location: after_sign_up_path_for(resource)
      # else
      #   set_flash_message! :notice, :"signed_up_but_#{resource.inactive_message}"
      #   expire_data_after_sign_in!
      #   respond_with resource, location: after_inactive_sign_up_path_for(resource)
      # end
    else
      render json: {
        status: :not_ok,
        message: "Cannot register: #{resource.errors.full_messages.join(', ')}",
      }, status: 400

      # clean_up_passwords resource
      # set_minimum_password_length
      # respond_with resource
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ishapi-0.1.8.194 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.193 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.192 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.191 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.190 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.189 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.188 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.187 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.185 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.184 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.183 app/controllers/ishapi/users/registrations_controller.rb
ishapi-0.1.8.182 app/controllers/ishapi/users/registrations_controller.rb