Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Connected Accounts does not account for the initial way you signed up #1032

Closed
ervinebalo opened this issue Oct 29, 2015 · 17 comments
Closed

Comments

@ervinebalo
Copy link

When viewing your profile and see what social accounts you have connected, it only shows you the social accounts you connected after you signed up already.

Meaning, if I originally signed up using Facebook, then connect G+, the view displays that I have G+ connected. I think it should also show Facebook.

// Check if there are additional accounts
    $scope.hasConnectedAdditionalSocialAccounts = function (provider) {
      for (var i in $scope.user.additionalProvidersData) {
        return true;
      }

      return false;
    };
@lirantal
Copy link
Member

@ervine13 this is using the latest master branch?

@ervinebalo
Copy link
Author

@lirantal yes.

@lirantal lirantal added this to the 0.5.0 milestone Oct 29, 2015
@lirantal
Copy link
Member

@ervine13 so it's always showing the last social account?
What happens if you sign-up with FB, then G+, then LI? what will it show?

@ervinebalo
Copy link
Author

@lirantal I'm sorry I wasn't clear. It will only show the subsequent social accounts, not the original.

Scenario 1

  1. Sign up with Fb
  2. Connect G+
  3. Connect Twitter
    I only see G+ and Twitter as my connected accounts

Scenario 2

  1. Sign up with G+
  2. Connect GH
  3. Connect LinkedIn
    I only see GH and LinkedIn as my connected accounts

Maybe the question is was this intentional that you only see the subsequent providers and not the original? What I was going to try is check the user.provider, not just user.additionalProvidersData

    // Check if there are additional accounts
    $scope.hasConnectedAdditionalSocialAccounts = function (provider) {
      for (var i in $scope.user.additionalProvidersData) {
        return true;
      }
      //check original
      if ($scope.user.provider === provider) {
        return true;
      }

      return false;
    };

@mleanos
Copy link
Member

mleanos commented Oct 30, 2015

@ervine13 I'm going to look into this. One quick question, in Senario 1 are you still logged into the FB provider & then in Scenario 2, you're still logged in with G+?

I'm wondering if it's just not listing the provider that you're logged in with. IIRC, the listed providers are there for removal. It might not allow you to remove the one you're logged in with; or the fact that it may be considered the primary.

Have you tried creating an account with the local provider, and then adding the additional social account providers? If so, what is the behavior?

Most of that is speculation, but I wanted to throw that out there as I dive into this.

@ervinebalo
Copy link
Author

@mleanos just tested the following

Test 1

  1. Sign up w FB
  2. Connect with G+
  3. Go to manage social accounts and only see G+
  4. Sign out
  5. Sign in with G+
  6. Go to manage social accounts and only G+ still

Test 2

  1. Sign up local
  2. Connect with FB
  3. Go to manage social accounts and only see FB
  4. Connect G+
  5. Now connected accounts show FB & G+

@codydaig
Copy link
Member

@ervine13 Thanks for the very detailed test results!

@mleanos
Copy link
Member

mleanos commented Oct 30, 2015

I've confirmed this behavior. Although, I only have tested this with one social account (Facebook).

Whichever provider is used to created the account, even local, is set to the user's provider field. If the account was created with a provider other than local, the providerData field is populated with data specific to that provider.

The Manage Social Accounts view is only listing additional providers that can be removed, and any other providers that have not been connected. Any providers other than the primary are stored in the additionalProvidersData field.

It won't be difficult to display the primary provider when it's not local. However, some extra consideration must be taken into account. What happens if the user tries to remove their primary provider? We would need to decide on how to handle that from a logical perspective. The implementation probably wouldn't be too difficult; we just need to figure out what we want to do.

With all that said, I think this is behaving as designed. There must have been a lack of direction on how to handle the above mentioned scenario.

The following HTML is an example of what we could add to the view, with no remove button. Just to signify what the primary provider is.

Primary Provider:<br/>
<div ng-hide="user.provider.toString() === 'local'" class="social-account-container">
  <img ng-src="/modules/users/client/img/buttons/{{user.provider}}.png">
</div>

@ervinebalo
Copy link
Author

I think that should suffice. As the user, I want to see all the social accounts that I have connected. When I didn't, I thought that maybe I didn't connect it* after all but it* also didn't show up as an option that I could connect it.

*The original social account.

@mleanos - if that's how you guys want to resolve the issue, if at all, would you like me to attempt to PR?

@mleanos
Copy link
Member

mleanos commented Oct 30, 2015

@ervine13 I don't think we'd be resolving the issue, per se. But by at least displaying the primary provider, we'd be making it clear to the user's as to what's going on. Less confusion.

By all means, submit a PR. We may be able to get it merged in for 0.4.2. For the bigger issue of actually managing the primary, and switching the primary, it will be something we'd have to address for 0.5.0.

@lirantal
Copy link
Member

lirantal commented Nov 1, 2015

Seems like a big fix which we should tackle as part of 0.5.0.
Whose up for it? :)

@mleanos
Copy link
Member

mleanos commented Nov 1, 2015

@lirantal I'd be more than happy to take this on :)

@ervine13 You still want to handle the displaying of the primary as a start to resolving this?

@lirantal
Copy link
Member

lirantal commented Nov 1, 2015

Thanks Michael!

@mleanos
Copy link
Member

mleanos commented Dec 30, 2015

@lirantal @codydaig @rhutchison @ervine13

How do we want to handle allowing switching/removing a user's primary provider? I see a few different aspects of this requirement..

  1. When the user wants to change their primary provider, and their provider is set to local
  • a) I guess we just overwrite this to whatever provider their switching to? Thus, "forgetting" about the local provider, since it's not needed for anything.
  • b) There's no need to display the fact that their primary provider is set to local.
  1. When the user wants to remove their primary provider, and they have no other provider setup
  • a) Should we switch their account to use local as their provider? And pull over their provider's data?
  • b) Should we delete their account?
  1. When the user wants to remove their primary provider, and has additional providers setup
  • a) We should provide a UI to choose which provider they would like to switch to as their primary
  • b) remove provider
  1. When the user wants to just switch their primary provider (not removing), and has additional providers
  • a) Provide same UI as (3) and do not remove provider

Any thoughts on these? Anything else?

I'd like to get moving on this. These considerations are more like business rules. I'm not 100% convinced that we need to add this type of thing out of the box, in the framework.

At the very least, we need to display every provider that has been setup for their account, and provide a clean way for them to remove each one. The feature of switching may not really be needed, but we will face similar logic considerations when removing providers.

@rhutchison
Copy link
Contributor

I started working on a solution, but it was closed in favor of "CleanMean"

What ever happened to that? Personally, I was not a fan of the design of cleanmean's user module, which is why I was working on something different.

@lirantal
Copy link
Member

lirantal commented Jan 3, 2016

@rhutchison can you sync with @mleanos about this to come up with a PR that solves this problem?

@mleanos
Copy link
Member

mleanos commented Jan 9, 2016

@rhutchison You want to work on this together? What in particular have you done so far?

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

No branches or pull requests

5 participants