Skip to content

Commit

Permalink
Also check if token registration stage is present
Browse files Browse the repository at this point in the history
  • Loading branch information
MidhunSureshR committed Apr 27, 2022
1 parent a9f0dbd commit 2de21b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/viewmodels/AccountSetupViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export class AccountSetupViewModel extends ViewModel {
"m.login.dummy"
];
for (const flow of flows) {
// Find the first flow that does not contain any unsupported stages
// Find the first flow that does not contain any unsupported stages but contains Token registration stage.
const containsUnsupportedStage = flow.stages.some(stage => !allowedStages.includes(stage));
if (!containsUnsupportedStage) {
const containsTokenStage = flow.stages.includes("m.login.registration_token") ||
flow.stages.includes("org.matrix.msc3231.login.registration_token");
if (!containsUnsupportedStage && containsTokenStage) {
return flow;
}
}
Expand Down

0 comments on commit 2de21b3

Please sign in to comment.