Sha256: 44d443aa068c5199feffbab5d225c20f36deefb0ddaf58764631a2381fda9a30

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

module <%= class_name %>
  class AuthorizationsController < ::<%= class_name %>Controller

    def index
    end

    def create
      user_identity = UserIdentity.find_or_create_with_omniauth(permitted_params, current_user)
      if signed_in?
        @app = user_application
      else
        sign_in user_identity
        render 'failure' and return unless signed_in?
        @app = current_user.user_applications.create
      end
    end

    protected

    def permitted_params
      params
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
billet-0.0.1 lib/generators/billet/namespace/templates/controllers/api_controllers/authorizations_controller.rb.erb