Closed DavidGeismarLtd closed 1 year ago
To make sure transfer_guest_to_user
was called on sign_up or sign_in. I had to add :
after_action :current_or_guest_user, only: :create
to both Devise::SessionsController and Devise::RegistrationsController
Providing you call current_or_guest_user
some time after sign_in, then that method will be executed, and the transfer will take place.
Can you explain your use case that doesn't call current_or_guest_user
after signing in?
I noticed that
transfer_guest_to_user
is not always executed on signin. Reading through the code, I noticed that thelogging_in
callback is triggered by the helper methodcurrent_or_guest_user
. So if you don't call this method sometimes during sign_in,transfer_guest_to_user
wont be executed I guess ?