heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
24k stars 5.55k forks source link

How To: Email only sign up #5717

Closed D00mguy17298 closed 19 hours ago

D00mguy17298 commented 1 month ago

Environment

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

Timjini commented 1 month ago

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

D00mguy17298 commented 1 month ago

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 commented 1 month ago

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

abdulbasitkhandeveloper commented 1 month ago

@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.

Sharpdev247 commented 1 month ago

@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 👍

nashby commented 19 hours ago

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