title: how to check if current_user is logged in through omniauth?
body: <p>If I have omniauth to allow users to log in using a provider such as facebook/twitter, how can I check to see if the current_user is logged in using omniauth?</p>
  
  <p>I want to allow a code to run only if the current_user is logged in through omniauth. </p>
  
  <p>Here's how my schema looks</p>
  
  <pre><code>create_table "users", :force =&gt; true do |t|
      t.string    "name"
      t.string    "email"
      t.timestamp "created_at",                         :null =&gt; false
      t.timestamp "updated_at",                         :null =&gt; false
      t.string    "password_digest"
      t.string    "remember_token"
  
    end
  
   create_table "authentications", :force =&gt; true do |t|
      t.integer  "user_id"
      t.string   "provider"
      t.string   "uid"
      t.datetime "created_at", :null =&gt; false
      t.datetime "updated_at", :null =&gt; false
      t.string   "secret"
      t.string   "token"
    end
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>    class PostsController &lt; ApplicationController
      def create
        @post = current_user.posts.build(params[:post])
  
        if @post.save
          if @post.check
            UserMailer.check_email(@user).deliver
          else
            flash[:success] = "Posted"
            Twitter::Client.new.update(@post.content) if logged_using_omniauth? request != nil
          end
          redirect_to root_path
        else
          @feed_items = []
          render 'static_pages/home'
        end
      end
  </code></pre>