oivoodoo / devise_masquerade

Extension for devise, enable login as functionality. Add link to the masquerade_path(resource) and use it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

back_masquerade_path(current_user) broken in newer versions

jason-hobbs opened this issue · comments

In versions < 2, this works perfectly:
back_masquerade_path(current_user)
In version 2 or greater, I get:
Couldn't find User with 'id'=admin-user
Screenshot 2022-10-30 at 8 17 21 PM

commented

@foundation-1 Hi everyone! Really sorry for having the issues. I will fix it during today/tomorrow.

I added as session storage implementation like record.to_param. saving id of the record and then I do .find() probably you have something friendly id as part of your user models.

@oivoodoo I am not using any friendly id, I am logged in as SuperAdmin(Masquerading) and Masqueraded User.
on <%= link_to "Logout", back_masquerade_path(current_user) %> I get this error and it seems that masquerading owner is not being correctly identified

Screenshot 2022-10-31 at 10 30 42 PM

Instead of finding User, I think it should find 'SuperUser' ( masquerading class )

I am using friendly id.

I updated to 2.0.3 and am still having the issue whereas with < 1 it works fine.

After upgrading the library, any current session saved in the cache get this error:

Couldn't find User with 'id'=true [WHERE "users"."blocked_at" IS NULL]
commented

@frodsan the major release 2.x.x is using by default session based masquerading