Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Re-order registration stages to do msisdn & email auth last #5174

Merged
merged 10 commits into from
May 16, 2019

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented May 10, 2019

This allows the client to complete the email last which is more
natual for the user. Without this stage, if the client would
complete the recaptcha (and terms, if enabled) stages and then the
registration request would complete because you've now completed a
flow, even if you were intending to complete the flow that's the
same except has email auth at the end.

Adding a dummy auth stage to the recaptcha-only flow means it's
always unambiguous which flow the client was trying to complete.
Longer term we should think about changing the protocol so the
client explicitly says which flow it's trying to complete.

element-hq/element-web#9586

dbkr added 2 commits May 10, 2019 11:09
This allows the client to complete the email last which is more
natual for the user. Without this stage, if the client would
complete the recaptcha (and terms, if enabled) stages and then the
registration request would complete because you've now completed a
flow, even if you were intending to complete the flow that's the
same except has email auth at the end.

Adding a dummy auth stage to the recaptcha-only flow means it's
always unambiguous which flow the client was trying to complete.
Longer term we should think about changing the protocol so the
client explicitly says which flow it's trying to complete.

element-hq/element-web#9586
@dbkr dbkr requested a review from a team May 10, 2019 10:12
dbkr added 4 commits May 10, 2019 11:14
It's more natural for the user if the bit that takes them away
from the registration flow comes last. Adding the dummy stage allows
us to do the stages in this order without the ambiguity.
@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #5174 into develop will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           develop    #5174   +/-   ##
========================================
  Coverage    61.74%   61.74%           
========================================
  Files          336      336           
  Lines        34635    34635           
  Branches      5689     5689           
========================================
  Hits         21386    21386           
  Misses       11721    11721           
  Partials      1528     1528

@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #5174 into develop will increase coverage by 0.01%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #5174      +/-   ##
===========================================
+ Coverage    61.75%   61.77%   +0.01%     
===========================================
  Files          336      336              
  Lines        34639    34646       +7     
  Branches      5692     5695       +3     
===========================================
+ Hits         21390    21401      +11     
+ Misses       11721    11719       -2     
+ Partials      1528     1526       -2

@dbkr dbkr changed the title Add a DUMMY stage to captcha-only registration flow Re-order registration stages to do msisdn & email auth last May 10, 2019
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

The code looks plausible, but as discussed in #synapse-dev: if this is going to be a thing that we are going to require clients to implement, please can it be specced first?

flow.insert(i, LoginType.TERMS)
inserted = True
break
if not inserted:
Copy link
Member

Choose a reason for hiding this comment

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

ftr you can do:

for ... :
   # ...
else:
   # we only get here if we fell off the end of the for

I'm unsure if the gain in not having to mess with inserted outweighs the loss of using a bit of an obscure language feature. up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yes - I guess whichever is more in-keeping with the code style, but personally I had to stop & think what that syntax does both times I've encountered it so I'd be inclined to keep it as-is.

@dbkr
Copy link
Member Author

dbkr commented May 14, 2019

Party like its matrix-doc PR 1999: matrix-org/matrix-spec-proposals#1999

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

fair enough then

@dbkr dbkr merged commit 07cff7b into develop May 16, 2019
turt2live added a commit to matrix-org/matrix-spec-proposals that referenced this pull request May 28, 2019
Fixes #1134

Evidence of this being the case is shown here: matrix-org/synapse#5174
turt2live added a commit to matrix-org/matrix-spec-proposals that referenced this pull request May 28, 2019
Fixes #1134

Evidence of this being the case is shown here: matrix-org/synapse#5174
@DMRobertson DMRobertson deleted the dbkr/add_dummy_flow_to_recaptcha_only branch June 28, 2022 11:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants