All threads / Skipping Devise Confirmation for Stripe Signup

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Skipping Devise Confirmation for Stripe Signup

Brian Gilbank asked in Rails

Hi Chris - How could I skip the Devise confirmation if a user is signing up to pay with Stripe?

I am following this video on your stripe course: https://courses.gorails.com/courses/payments-with-rails-master-class/152586-subscriptions-with-stripe-billing/451458-3-4-new-subscription-form

I was hoping I could do something like below.

class Users::RegistrationsController < Devise::RegistrationsController
invisible_captcha only: [:create], honeypot: :telephone, scope: :user, on_spam: :return_succeded

def create
super
if @user.persisted?
UserMailer.newuser_email(@user).deliver
end
if @user.persisted? && current_user.subscribed?
@user.skip_confirmation!
@user.confirm
end
end

end

Thanks
Brian

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 41,443+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.