app/controllers/api/sessions_controller.rb
# returns information depending on if a user is signed in or not

returns information depending on if a user is signed in or not
returns information depending on if a user is signed in or not
def ping
    if user_signed_in?
      current_user.ensure_authentication_token!
      most_recent_auth = Authorization.where(:user_id => current_user.id).order('updated_at DESC').first!
      render :json => Api::SessionsController.login_info(current_user, current_user, most_recent_auth.provider).to_json, :status => :ok
    else
      render :json => Api::SessionsController.fail_login_info('Not logged in.',nil).to_json, :status => :ok
    end
  end
def ping if user_signed_in? current_user . ensure_authentication_token! most_recent_auth = Authorization . where ( :user_id => current_user . id ) . order ( 'updated_at DESC' ) . first! render :json => Api :: SessionsController . login_info ( current_user , current_user , most_recent_auth . provider ) . to_json , :status => :ok else render :json => Api :: SessionsController . fail_login_info ( 'Not logged in.' , nil ) . to_json , :status => :ok end end
returns information depending on if a user is signed in or not
returns information depending on if a user is signed in or not
# cancan auth check
 #authorize!
 # get the most recently used provider
