Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:41:59+00:00 2026-05-27T19:41:59+00:00

My app is set up so that if a user signs in with Oauth

  • 0

My app is set up so that if a user signs in with Oauth or Openid, they don’t have to confirm their email address. However, Devise is still sending email confirmations. When I call User.skip_confirmation! I get an undefined method error. My model:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable, :recoverable, :rememberable, 
  :trackable, :validatable, :confirmable, :lockable, :token_authenticatable, :omniauthable

  attr_accessible :username, :email, :password, :password_confirmation, :remember_me
  validates_presence_of :username
  validates_uniqueness_of :username, :case_sensitive => false

  def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
    data = access_token.extra.raw_info
    if user = User.where(:email => data.email).first
      user
    else 
      #User.skip_confirmation!
      User.create!(:username => data.name, :email => data.email, :password =>    Devise.friendly_token[0,20]) 
    end
  end

  def skip_confirmation!
   self.confirmed_at = Time.now
 end
end

My Controller:

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def facebook
    @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
    @user.skip_confirmation!
    if @user.persisted?
      sign_in @user
      @fname = @user.username
      redirect_to root_path, :flash => { :success => "Welcome #{@fname}!" }
    else
      session["devise.facebook_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end
end

thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:42:00+00:00Added an answer on May 27, 2026 at 7:42 pm

    You need to skip confirmation before you create the User objects and its persisted to the database. So the user creation part of your method would look like

    user = User.new(:username => data.name, :email => data.email, :password =>    Devise.friendly_token[0,20])
    user.skip_confirmation!
    user.save
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've set up a small app that takes an email address and saves it,
For my app, I have a fairly complex set of configuration options that user
I have a Rails app set up so that when a user uploads an
I have set up an app that is registered for remote notifications. - (void)application:(UIApplication*)application
I'm creating an iPhone app that will have a preloaded set of locations with
I have an Android app that begins by displaying a dialog. When I set
I have an ASP.NET app that requires users to sign in with their domain
The question is very strange: i have done an app that set an Alarm
I have a service that user can configure to run during off-peak hours. They
I have a small application with a CheckBox option that the user can set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.