I'm trying to add omniauth functionality in my app. For authentication
I'm using devise

This is what I'm doing

# GemFile

gem 'omniauth'
gem 'omniauth-github', '~> 1.1.2'

# Devise.rb
   config.omniauth :github, 'ID', 'Secret key'

# User.rb

devise :database_authenticatable, :registerable, :confirmable,
          :recoverable, :rememberable, :trackable, :validatable,
          :omniauthable, :omniauth_providers => [:github]

   def self.from_omniauth(auth)
     where(provider: auth.provider, uid: auth.id).first_or_create do
       user.provider = auth.provider
       user.uid = auth.uid
       user.email = auth.info.email
       user.password = Devise.friendly_token[0,20]
     end
   end

Whenever I do http://localhost/login it shows me following error message [0]

Where I'm making mistake, please correct me.

[0] : http://awesomescreenshot.com/0d9492h900

--
Cheers!

Deepak Kumar Sharma
Blog: http://deekysharma.wordpress.com

" Mistakes are proof that you are trying "

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALDHwN6qgaB1-mDMfGNo_g1GfsUHRW9BJm8g-7fBHi7hEyAWTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Colin Law at Jan 22, 2015 at 8:57 pm

    On 22 January 2015 at 20:16, Deepak Sharma wrote:
    I'm trying to add omniauth functionality in my app. For authentication
    I'm using devise

    This is what I'm doing

    # GemFile

    gem 'omniauth'
    gem 'omniauth-github', '~> 1.1.2'

    # Devise.rb
    config.omniauth :github, 'ID', 'Secret key'

    # User.rb

    devise :database_authenticatable, :registerable, :confirmable,
    :recoverable, :rememberable, :trackable, :validatable,
    :omniauthable, :omniauth_providers => [:github]

    def self.from_omniauth(auth)
    where(provider: auth.provider, uid: auth.id).first_or_create do
    user.provider = auth.provider
    user.uid = auth.uid
    user.email = auth.info.email
    user.password = Devise.friendly_token[0,20]
    end
    end

    Whenever I do http://localhost/login it shows me following error message [0]

    Where I'm making mistake, please correct me.

    [0] : http://awesomescreenshot.com/0d9492h900
    It is generally better to copy/paste errors from the server window
    rather than use a screenshot. In this case it would have made it
    easier for me to point out the error. There is a typo in the line
    shown onscreen, it has provdiers instead of providers.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu5j0dS__CD-bqqUQTR%2B9g-GtbUgT1V2S%3Dt5oHu1NkWyg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Deepak Sharma at Jan 23, 2015 at 5:25 am

    On Fri, Jan 23, 2015 at 2:27 AM, Colin Law wrote:
    It is generally better to copy/paste errors from the server window
    rather than use a screenshot. In this case it would have made it
    easier for me to point out the error.
    Sorry for that, will take care for next time.
    There is a typo in the line shown onscreen, it has provdiers instead of providers
    Thanks for help. It works!

    --
    Cheers!

    Deepak Kumar Sharma
    Blog: http://deekysharma.wordpress.com

    " Mistakes are proof that you are trying "

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALDHwN50-wrWnSpaz2KPPpQ%3DLfPMrvfceuMMJ9kqRNi8xa8yaw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Colin Law at Jan 23, 2015 at 8:51 am

    On 23 January 2015 at 05:25, Deepak Sharma wrote:
    On Fri, Jan 23, 2015 at 2:27 AM, Colin Law wrote:

    It is generally better to copy/paste errors from the server window
    rather than use a screenshot. In this case it would have made it
    easier for me to point out the error.
    Sorry for that, will take care for next time.
    There is a typo in the line shown onscreen, it has provdiers instead of providers
    Thanks for help. It works!
    It is always worth while reading error messages very carefully, there
    is often a useful clue there.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvB_g8be87fZ7gEm7NqUDUW5i68_3yJWkgL5avfz7ZQ5w%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 22, '15 at 8:16p
activeJan 23, '15 at 8:51a
posts4
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Deepak Sharma: 2 posts Colin Law: 2 posts

People

Translate

site design / logo © 2022 Grokbase