Skip to content

Clean up default account changes on login. - #5044

Closed
kurzee wants to merge 1 commit into
developfrom
issue/5042-duplicate-login
Closed

kurzee wants to merge 1 commit into
developfrom
issue/5042-duplicate-login

Conversation

@kurzee

@kurzee kurzee commented Mar 28, 2016

Copy link
Copy Markdown
Contributor

Fixes #5042

This expands an older fix (#3401) in which the current default account was removed when the user was re-authing and happened to change accounts. Now, we'll always remove the current default account if it is different than the newly authenticated account, on login.

Dropping this one for develop rather than release/6.1 as the fixes are a bit different and not necessarily a hot-fix.

To test:

  1. Run the steps in NUX: Duplicate log in bug #5042
  2. The newly authenticated account should now be the only connected account.

Needs review: @aerych at your convenience please señor. (We can hold off on this for now if your magic links change this)

@kurzee kurzee added the nux label Mar 28, 2016
@kurzee kurzee added this to the 6.2 milestone Mar 28, 2016
@kurzee kurzee changed the title Updating implementation to clean up default account changes on login. Clean up default account changes on login. Mar 28, 2016
@aerych aerych self-assigned this Mar 28, 2016

return [accountService createOrUpdateAccountWithUsername:username authToken:authToken];
WPAccount *account = [accountService createOrUpdateAccountWithUsername:username authToken:authToken];
if (![accountService.defaultWordPressComAccount.uuid isEqualToString:account.uuid]) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add business logic to facades. The work being done probably has a better home in AccountService createOrUpdateAccountWithUsername:authToken:

@aerych

aerych commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

Hiya @kurzee
Tested and everything works well :) I just had one comment but otherwise I think its good to go.

@kurzee

kurzee commented Mar 30, 2016

Copy link
Copy Markdown
Contributor Author

Since the mention of not having logic in the facade, I got to thinking... The AccountService class and users of the class both try to detect and manage the state of the defaultWordPressComAccount, creating issues similar to what's seen here.

I'm going to close this PR and instead work on a slight refactor of AccountService to try and sort out the handling of the defaultWordPressComAccount to avoid this same kind of issue.

Thanks for the review anyways @aerych!

@kurzee kurzee closed this Mar 30, 2016
@kurzee kurzee mentioned this pull request Apr 1, 2016
@kurzee
kurzee deleted the issue/5042-duplicate-login branch April 1, 2016 22:05
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

Successfully merging this pull request may close these issues.

NUX: Duplicate log in bug

2 participants