17 lines
815 B
Ruby
17 lines
815 B
Ruby
module Dunlop::Ember
|
|
class UsersController < Dunlop::Ember::ApplicationController
|
|
def me
|
|
if respond_to?(:current_user) and current_user.present?
|
|
user = current_user
|
|
sign_out user # no more current_user, needed to allow sign_in using store: true to work (devise v4.3.0)
|
|
sign_in user, store: true # create session if not exist, only needed for hybrid rails/api integrations like ePOTS. Otherwise api only without store is sufficient
|
|
#sign_in current_user, store: true # create session if not exist, only needed for hybrid rails/api integrations like ePOTS. Otherwise api only without store is sufficient
|
|
#warden.set_user current_user, store: true
|
|
render json: current_user, serializer: UserSerializer
|
|
else
|
|
head 404
|
|
end
|
|
end
|
|
end
|
|
end
|