-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Re-order registration stages to do msisdn & email auth last #5174
Conversation
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
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 Report
@@ 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 Report
@@ 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 |
There was a problem hiding this 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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Party like its matrix-doc PR 1999: matrix-org/matrix-spec-proposals#1999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough then
Fixes #1134 Evidence of this being the case is shown here: matrix-org/synapse#5174
Fixes #1134 Evidence of this being the case is shown here: matrix-org/synapse#5174
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