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

Username should be cleared on signout #37

Open
ndarilek opened this issue Jul 16, 2014 · 9 comments
Open

Username should be cleared on signout #37

ndarilek opened this issue Jul 16, 2014 · 9 comments
Assignees

Comments

@ndarilek
Copy link

Currently the code reads:

  hoodie.account.on(eventName, function (username) {
    $rootScope.$apply(function () {
      service.username = username;
    });

My understanding of Hoodie is that hoodie.account.username is defined if a user is logged in, but the signout event is called with the username of the signing-out user. So once you are signed in, there is no way to clear hoodieAccount.username. I'm guessing this code should check for the signout event and set hoodieAccount.username to null in that case.

I'm fairly new to Hoodie, so I may be wrong. I currently have an Angular app that, once I'm logged in, I can't log out of until I reload and get a fresh scope. Things react fine when I log in and username is assigned an initial value, but it never clears even when hoodie:signout fires.

@davidpfahler
Copy link

I can confirm this issue. It basically makes it impossible to completely sign out without a page refresh.

davidpfahler pushed a commit to excellenteasy/hoodie-plugin-angularjs that referenced this issue Jul 16, 2014
ndarilek added a commit to ndarilek/hoodie-plugin-angularjs that referenced this issue Jul 18, 2014
@ndarilek
Copy link
Author

Ah, didn't get a notification about the other PR for this issue.

I don't really care which gets merged, but this fix is definitely needed ASAP. I too can confirm that clearing username on signout makes my app work as expected.

Thanks!

@davidpfahler
Copy link

@ndarilek Ha! Seems like better communication would have saved you some work. Sorry about that. Sometimes GitHub works in mysterious ways.

The real problem is, however, that I cannot run tests. I'm grateful we have this plugin, don't get me wrong, but the repo and process is kind of a mess. Why is there a Gulpfile and a Gruntfile. Either way, non of which worked for me. /cc @elmarburke @robinboehm

@robinboehm
Copy link
Collaborator

Hey guys,

great work here! Sorry for the problems with our build system.
We removed grunt and now using gulp for everything. ddda91d
Finished that now.

Is this issue solved by #37 or #38?
May you want to create tests for this case together.

<3

davidpfahler pushed a commit to excellenteasy/hoodie-plugin-angularjs that referenced this issue Jul 22, 2014
@davidpfahler
Copy link

@robinboehm #37 is this issue. #38 would fix it, but I cannot test, because running tests is still broken in many ways, please see PR for details.

I will write a test for this change as soon as tests work again. Thanks in advance.

@robinboehm
Copy link
Collaborator

Oki, I'll take a look at it as soon as possible.

Robin Böhm

Send from mobile

On 22.07.2014, at 16:15, David Pfahler [email protected] wrote:

@robinboehm #37 is this issue. #38 would fix it, but I cannot test, because running tests is still broken in many ways, please see PR for details.

I will write a test for this change as soon as tests work again. Thanks in advance.


Reply to this email directly or view it on GitHub.

@elmarburke elmarburke added the bug label Aug 4, 2014
@elmarburke elmarburke self-assigned this Aug 4, 2014
@elmarburke
Copy link
Owner

In progress

davidpfahler pushed a commit to excellenteasy/hoodie-plugin-angularjs that referenced this issue Aug 5, 2014
@idanb11
Copy link

idanb11 commented Feb 3, 2015

Please add @davidpfahler commit for fixing this issue...

👍

@elmarburke
Copy link
Owner

As soon as someone* wrote a test for it.

*) it's on my todo list since august… Feel free to commit

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

Successfully merging a pull request may close this issue.

5 participants