Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unimpersonate not working 100% #10

Open
Siyfion opened this issue Sep 16, 2015 · 11 comments
Open

Unimpersonate not working 100% #10

Siyfion opened this issue Sep 16, 2015 · 11 comments

Comments

@Siyfion
Copy link
Contributor

Siyfion commented Sep 16, 2015

Hey @gwendall! It's been a while, 😄

So I am getting an issue whereby my "Stop Impersonating" button fires the "click [data-unimpersonate]" event and calls Impersonate.undo(); but the isImpersonating helper doesn't seem to refresh reactively, and neither does my other account UI related stuff... I was just wondering if there are any known issues with this currently?

Here's an output of my console after trying to stop impersonating.

screen shot 2015-09-16 at 11 06 07

@Siyfion
Copy link
Contributor Author

Siyfion commented Sep 24, 2015

@gwendall I don't suppose you've had a chance to take a look at this yet? 😞

@thsowers
Copy link

+1 Can only unimpersonate by hitting reload button

@DavidSichau
Copy link

Using Meteor 1.2.0.2 I see the same error.

@Siyfion
Copy link
Contributor Author

Siyfion commented Oct 12, 2015

Glad it's not just me, although I have no idea what's causing it, the code's changed quite a lot since I was last involved! @gwendall

@Siyfion
Copy link
Contributor Author

Siyfion commented Nov 4, 2015

@gwendall You alive?

@derhansen
Copy link

+1 Same problem here

@stocksp
Copy link

stocksp commented Nov 24, 2015

What's causing the problem is obvious.
The user object is never updated (code is commented out) and the select for the isValid is wrong.
look at the commit in "added a way to check for role-group user rights"
This is the code you need. Have no idea why it was changed to this broken code.

Clone this project into your packages folder.
In the server/lib.js uncomment these

/*
      var selector = { _id: currentUser };
      var modifier = { $set: { _impersonateToken: params.token }};
      Meteor.users.update(selector, modifier);
      */

change line 55 from

"services.impersonate.token"

to

"_impersonateToken"

there are a couple of other 'issues' on the client ... but this should get you running.

@Siyfion
Copy link
Contributor Author

Siyfion commented Nov 24, 2015

@stocksp Good spot. Perhaps submit a PR?

Or alternatively, fork it and publish a fixed version?

@stocksp
Copy link

stocksp commented Nov 24, 2015

I think the chances of the owner of this repo responding to a PR is zero, or they would have fixed this baby. I've modified the code (and added logging) so its not as simple as just pushing out what I have into a fork. I'm under the gun for the next couple of weeks, but will look into it. Its REALLY easy to just clone this repo into your own project though.

@Siyfion
Copy link
Contributor Author

Siyfion commented Feb 8, 2016

@stocksp I don't suppose you have reconsidered creating a fork of this with the fix?

@stocksp
Copy link

stocksp commented Feb 8, 2016

pavanputhra already did one.....
https://github.com/pavanputhra/meteor-impersonate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants