Skip to content

Stop moving provider identities between account of a user #3032

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

Merged
merged 3 commits into from
Feb 1, 2021

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Jan 27, 2021

With these change Gitpod stops moving identities between accounts of a user.

What's inside?

Access Control

On /access-control you now see the provider identity you've connected with, and you get the option to disconnect.

Screen Shot 2021-01-27 at 13 24 06

Confirm disconnecting a provider from your account:

Screen Shot 2021-01-27 at 13 24 22

Last (or the single) provider identity is a special one, and account deletion sounds is the way how to proceed, otherwise we end up with unreachable accounts.

Screen Shot 2021-01-27 at 13 24 33

Instead of moving provider identities between accounts.

Let's guide the user, and give them the options to select and manage accounts.

When we see that a provider identity is connected to a second account, we provide as much details as possiblenecessary to let them decide on the next step.

  • in case it wasn't clear that two accounts were created, we provide names to these provider identities
  • in general we encourage to review the accounts and decide on a main account to proceed with, i.e. disconnect from providers or even let accounts go, if they aren't wanted.

Screen Shot 2021-01-29 at 12 44 56

@AlexTugarev AlexTugarev linked an issue Jan 27, 2021 that may be closed by this pull request
@AlexTugarev AlexTugarev force-pushed the at/identities branch 2 times, most recently from 6acfca5 to 4b8a5c8 Compare January 27, 2021 11:40
@AlexTugarev AlexTugarev requested a review from gtsiolis January 27, 2021 13:47
@AlexTugarev AlexTugarev marked this pull request as ready for review January 27, 2021 13:48
@AlexTugarev AlexTugarev requested a review from csweichel January 28, 2021 08:13
in a situation where the browser agent might submit the terms form more than once, we should avoid creating new accounts. instead, we need to select the recently created account for a login in a parallel session.
@AlexTugarev AlexTugarev force-pushed the at/identities branch 3 times, most recently from cb848b0 to 16c6d11 Compare January 29, 2021 11:22
@@ -826,7 +826,6 @@ footer .logo-icon {


.access-control__card-container {
width: 31%;
Copy link
Member Author

Choose a reason for hiding this comment

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

fixing a bogus line wrap occurring with longer hostnames of self-hosted git providers.

@@ -148,13 +158,15 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
variant='text'
color={'secondary'}
onClick={this.onDecline}
disabled={this.state.submitted}
Copy link
Member Author

Choose a reason for hiding this comment

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

to prevent resubmission if we have a long line to the proxy or dashboard, i.e. make it impossible to resubmit.

log.info(`(TOS) User was created in a parallel browser session, let's login...`, { logPayload });
await this.loginCompletionHandler.complete(req, res, { user, authHost: tosFlowInfo.authHost, returnToUrl: authFlow.returnTo });
} else {
await this.handleTosProceedForNewUser(req, res, authFlow, tosFlowInfo, req.body);
Copy link
Member Author

Choose a reason for hiding this comment

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

fyi, this is the previous default code path

const user = await this.userService.findUserForLogin({ candidate: tosFlowInfo.candidate });
if (user) {
log.info(`(TOS) User was created in a parallel browser session, let's login...`, { logPayload });
await this.loginCompletionHandler.complete(req, res, { user, authHost: tosFlowInfo.authHost, returnToUrl: authFlow.returnTo });
Copy link
Member Author

Choose a reason for hiding this comment

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

fyi, this is new: if we retry searching for a user and find one, we definitely should not create new account, but login in into the existing one.

@AlexTugarev AlexTugarev requested a review from geropl January 29, 2021 13:02
@AlexTugarev AlexTugarev added this to the January 2021 milestone Jan 29, 2021
Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this issue @AlexTugarev! It took me longer than expected to reproduce this on the preview environment but here're some thoughts on the UX here. Let me know what you think. 🏀

`,
content: `
# Before we proceed
# Create a new Gitpod account with {{AUTH_HOST}}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: We're certainly going to improve this page later on but let me know if you think thee following seems like an improvement that can fit into this iteration. Feel free to leave this out of the scope of this PR and create a follow-up issue.

BEFORE AFTER ALTERNATIVE
image image image

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll get to this later 🙏🏻

const otherIdentitiesOfUser = user.identities.filter(i => i.authProviderId !== authProvider.authProviderId);
if (otherIdentitiesOfUser.length === 0) {
message = (<DialogContentText>
Disconnecting the single remaining provider would make your account unreachable. Please go the settings, if you want to delete the account.
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Do you think it could be practical to offer account deletion in this step?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather not do this. Adding some extra cycles to avoid deleting by accident could be helpful in some cases.

Also, this is something I'd like to push to a follow-up discussion and PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

DEAL 🤝

Copy link
Member Author

Choose a reason for hiding this comment

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

Awesome! 🤝

<ApplicationFrame service={service}>
<div className='content content-area'>

<h3>Cannot connect with {otherUser.authHost}</h3>
Copy link
Contributor

@gtsiolis gtsiolis Jan 29, 2021

Choose a reason for hiding this comment

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

suggestion: What do you think of the following? We can keep the verbs like switch if you think this describes more accurate what's going on.

BEFORE AFTER
image image

Copy link
Member Author

Choose a reason for hiding this comment

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

Created ${days} days ago and the recommendation on the Primary account is postponed. We'd discuss this separately.

For now we agreed on Other account, as we're missing some infos from server to do it.

OTOH, many thanks on the layout work, @gtsiolis! Awesome!

Copy link
Contributor

@csweichel csweichel left a comment

Choose a reason for hiding this comment

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

Code-wise LGTM.

@AlexTugarev AlexTugarev force-pushed the at/identities branch 4 times, most recently from 4ae48a1 to 4fb4a03 Compare January 29, 2021 16:56
* allow our users to disconnect provider identities from their accounts

* when a user tries to connect with a provider, for which there is already a connection to anther account, we redirect to an assistance page. a summary should help to review both accounts. in the end, any user may decide to move to a single account by disconnecting the provider identities from the other account.
  this way we can guarantee to not automagically lock out users from accounts with subscriptions or any meaningful data.

* show `Connected as`

* update terms renderer

Signed-off-by: Alex Tugarev <[email protected]>
@AlexTugarev
Copy link
Member Author

AlexTugarev commented Feb 1, 2021

Testing once again before merging 🙏🏻

@AlexTugarev AlexTugarev merged commit e8adb24 into master Feb 1, 2021
@AlexTugarev AlexTugarev deleted the at/identities branch February 1, 2021 07:06
@AlexTugarev AlexTugarev mentioned this pull request Feb 1, 2021
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.

Moving identities results in dead acounts
3 participants