devise icon indicating copy to clipboard operation
devise copied to clipboard

How To: Email only sign up

Open D00mguy17298 opened this issue 1 year ago • 5 comments

Environment

  • Ruby 3.3.3
  • Rails 7.1.4
  • Devise 4.9.4

Current behaviour

Using the devise gem to make email only sign up according to instructions given only works until the sign-up button is pressed. Afterwards all routes are redirected to localhost:3000

Expected behaviour

All routes should work properly afterwords

D00mguy17298 avatar Sep 30 '24 08:09 D00mguy17298

@D00mguy17298 sounds like something is missing in routes.rb, can you share the User model, and auth controller?

Timjini avatar Sep 30 '24 21:09 Timjini

What has been written in confirmations controller file

class Users::ConfirmationsController < Devise::ConfirmationsController protected def after_confirmation_path_for(resource_name, resource) token = resource.send(:set_reset_password_token) edit_password_path(resource, reset_password_token: token) end

end

Here are routes:

Rails.application.routes.draw do devise_for :users, controllers: { confirmations: "users/confirmations" }

get "up" => "rails/health#show", as: :rails_health_check

end

Here is model file user.rb:

class User < ApplicationRecord

devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :confirmable

     protected
     def password_required?
      confirmed? ? super : false
    end

end

D00mguy17298 avatar Oct 01 '24 07:10 D00mguy17298

I did it the same way as shown in the how to page

D00mguy17298 avatar Oct 02 '24 07:10 D00mguy17298

@D00mguy17298, please watch this video. There are many ways to accomplish this, but the best approach is to follow the video, especially if you're not very familiar with Rails.

You can also check the documentation here: link. LMK, If you are still facing the issue.

abdulbasitkhandeveloper avatar Oct 07 '24 09:10 abdulbasitkhandeveloper

@abdulbasitkhandeveloper I'm also having this issue because I'm new to Rails. After watching the video I'm able to send the Email using the gem called mailcatcher. Thanks you 👍

Sharpdev247 avatar Oct 07 '24 10:10 Sharpdev247

Please do not use the issues tracker for help or support, try Stack Overflow.

nashby avatar Nov 12 '24 20:11 nashby