Sha256: 338a4b8c759c948c9aa9f5d48c60312f9561e4e55a16e322dc67de2af4308061

Contents?: true

Size: 1010 Bytes

Versions: 14

Compression:

Stored size: 1010 Bytes

Contents

module Ishapi
  module My
    class MyController < Ishapi::ApplicationController

      before_action :check_profile

      # @TODO: move to users_controller
      def account
        @profile = current_user&.profile
        authorize! :show, @profile
        render 'ishapi/users/account'
      rescue CanCan::AccessDenied
        render json: {
          status: :not_ok,
        }, status: 401
      end

=begin
      private

      def do_login
        token = decode(params[:jwtToken])
        @current_user = User.find(token["user_id"])
      end

      def set_profile
        begin
          @graph   = Koala::Facebook::API.new( params[:accessToken] )
          me       = @graph.get_object( 'me', :fields => 'email' )
          @profile = IshModels::UserProfile.find_by :email => me['email']
        rescue Koala::Facebook::AuthenticationError => e
          render :json => { :status => :not_ok, :errors => "Probably expired token." }
          return
        end
      end
=end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ishapi-0.1.8.165 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.164 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.162 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.161 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.160 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.159 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.158 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.157 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.156 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.155 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.154 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.153 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.151 app/controllers/ishapi/my/my_controller.rb-trash
ishapi-0.1.8.150 app/controllers/ishapi/my/my_controller.rb-trash