You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Do no-auth-flow error handling more properly
This commit is contained in:
@@ -383,9 +383,12 @@ InteractiveAuth.prototype = {
|
|||||||
// in general this is not really going to be an accurate error message.
|
// in general this is not really going to be an accurate error message.
|
||||||
// Ideally this would signal what inputs could be removed such that a matching
|
// Ideally this would signal what inputs could be removed such that a matching
|
||||||
// flow could be found.
|
// flow could be found.
|
||||||
throw new Error(
|
const err = new Error("No appropriate authentication flow found");
|
||||||
"This server does not support registration with a phone number",
|
err.required_stages = [];
|
||||||
);
|
if (haveEmail) err.required_stages.push(EMAIL_STAGE_TYPE);
|
||||||
|
if (haveMsisdn) err.required_stages.push(MSISDN_STAGE_TYPE);
|
||||||
|
err.available_flows = flows;
|
||||||
|
throw err;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user