Optional
authOptional
clientIf resuming an existing interactive auth session, the client secret for that session
Optional
emailIf returning from having completed m.login.email.identity auth, the sid for the email verification session.
Optional
inputsInputs provided by the user and used by different stages of the auto process. The inputs provided will affect what flow is chosen.
A matrix client to use for the auth process
Optional
sessionIf resuming an existing interactive auth session, the sessionId of that session.
Optional
supportedIf specified, will prefer flows which entirely consist of listed stages. These should normally be of type AuthTypes but can be string when supporting custom auth stages.
This can be used to avoid needing the fallback mechanism.
Optional
busyCalled whenever the interactive auth logic becomes busy submitting information provided by the user or finishes. After this has been called with true the UI should indicate that a request is in progress until it is called again with false.
Called with the new auth dict to submit the request. Also passes a second deprecated arg which is a flag set to true if this request is a background request. The busyChanged callback should be used instead of the background flag. Should return a promise which resolves to the successful response or rejects with a MatrixError.
A function that takes the email address (string), clientSecret (string), attempt number (int) and sessionId (string) and calls the relevant requestToken function and returns the promise returned by that function. If the resulting promise rejects, the rejection will propagate through to the attemptAuth promise.
Optional
startCalled when the status of the UI auth changes, ie. when the state of an auth stage changes of when the auth flow moves to a new stage. The arguments are: the login type (eg m.login.password); and an object which is either an error or an informational object specific to the login type. If the 'errcode' key is defined, the object is an error, and has keys: errcode: string, the textual error code, eg. M_UNKNOWN error: string, human readable string describing the error
The login type specific objects are as follows: m.login.email.identity: * emailSid: string, the sid of the active email auth session
Error response from the last request. If null, a request will be made with no auth before starting.