devise icon indicating copy to clipboard operation
devise copied to clipboard

Rails 7 Cancel My Account

Open erdemtopal opened this issue 2 years ago • 6 comments

Devise "Cancel my account" is not responsing. turbo_devise_gem else / redirect gives error.

  • Ruby 3.0.1
  • Rails 7.0.2.3
  • Latest Devise

I hope devise gem is going to suitable for rails 7 soon

erdemtopal avatar Mar 12 '22 15:03 erdemtopal

on 7.0.2.3 I'm seeing the error again of basically no Devise pages responding as expected.

the Rails-side does this for me when I log in:

16:26:26 web.1  | Started POST "/users/sign_in" for 127.0.0.1 at 2022-03-22 16:26:26 -0400
16:26:26 web.1  | Processing by Devise::SessionsController#create as TURBO_STREAM
16:26:26 web.1  |   Parameters: {"authenticity_token"=>"[FILTERED]", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
16:26:26 web.1  |   User Load (1.4ms)  SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["email", "[email protected]"], ["LIMIT", 1]]
16:26:26 web.1  | Redirected to http://127.0.0.1:3000/
16:26:26 web.1  | Completed 302 Found in 290ms (ActiveRecord: 1.4ms | Allocations: 2333)
16:26:26 web.1  | 
16:26:26 web.1  | 
16:26:26 web.1  | Started GET "/" for 127.0.0.1 at 2022-03-22 16:26:26 -0400
16:26:26 web.1  | Processing by HomeController#index as TURBO_STREAM
16:26:26 web.1  |   Rendering home/index.erb
16:26:26 web.1  |   Rendered home/index.erb (Duration: 0.0ms | Allocations: 15)
16:26:26 web.1  | Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 339)
16:26:26 web.1  | 
16:26:26 web.1  | 

the browser side does this: Screen Shot 2022-03-22 at 4 29 47 PM

this appears with the main branch of devise as of today, 2022-03-22, against tubro-rails 1.0.1 and an app I made last week rails 7.0.2.2

gem 'devise', git: 'https://github.com/heartcombo/devise.git'

I will try to create a reproduction app again. I fear there may be some blame game going on here between Rails + Devise maintainers here because this has been going for quite a while. I think what happens here will significantly affect the future of the ecosystem and whether or not people actually come back to Rails at all.

I too would like to get to the bottom of this because it has gone on for months and months now and these error messages are extremely disappearing and confusing to work with.

jasonfb avatar Mar 22 '22 20:03 jasonfb

I should mention these are brand new esbuild apps running with ./bin/dev and jsbundling. what I'm seeing is that the front end just doesn't change after a form submission but the Rails-side mysteriously processes both the session, the redirect, and the GET to the home controller itself.

also I have this in my HomeController:

class HomeController < ApplicationController
  def index
    respond_to do |format|
      format.html
      format.turbo_stream
    end

  end
end

and a corresponding files at home/index.erb and home/index.turbo_stream.erb but still the symptom persists.

jasonfb avatar Mar 22 '22 20:03 jasonfb

I fear there may be some blame game going on here between Rails + Devise maintainers here because this has been going for quite a while.

I don't understand what you mean here. I am a Devise & Rails core maintainer.


It's been stated a few times that Devise does not work with Turbo yet, but it does work with Rails 7 as long as turbo features are disabled on Devise related forms/links. If you need/want to use Turbo, there are a couple of PRs that might be of help, just search around.

It will be eventually fixed and there will be a new Devise version that is fully compatible, we are just not there yet.

carlosantoniodasilva avatar Mar 22 '22 20:03 carlosantoniodasilva

@erdemtopal -- I think the answer is here https://github.com/heartcombo/devise/pull/5340

jasonfb avatar Mar 22 '22 20:03 jasonfb

@carlosantoniodasilva -- I meant no offense personally. I think lots and lots of people are going down this rabbit hole from what I can tell which seems like an opportunity for better documentation at the very least. Notwithstanding, your request for patience from the community is highly reasonable.

jasonfb avatar Mar 22 '22 20:03 jasonfb

Is there a rails 7 integration guide because I'm having problems also

mices avatar Aug 06 '22 11:08 mices

The main branch should contain all that's necessary for fully working with Turbo now, which should fix this. A new version will be released soon, but feel free to test it out from the main branch in the meantime, and report back on any issues. Thanks.

carlosantoniodasilva avatar Feb 09 '23 21:02 carlosantoniodasilva