@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17- import { createClient } from 'matrix-js-sdk/src/matrix' ;
17+ import { AuthType , createClient } from 'matrix-js-sdk/src/matrix' ;
1818import React , { Fragment , ReactNode } from 'react' ;
1919import { MatrixClient } from "matrix-js-sdk/src/client" ;
2020import classNames from "classnames" ;
@@ -34,7 +34,7 @@ import RegistrationForm from '../../views/auth/RegistrationForm';
3434import AccessibleButton from '../../views/elements/AccessibleButton' ;
3535import AuthBody from "../../views/auth/AuthBody" ;
3636import AuthHeader from "../../views/auth/AuthHeader" ;
37- import InteractiveAuth from "../InteractiveAuth" ;
37+ import InteractiveAuth , { InteractiveAuthCallback } from "../InteractiveAuth" ;
3838import Spinner from "../../views/elements/Spinner" ;
3939import { AuthHeaderDisplay } from './header/AuthHeaderDisplay' ;
4040import { AuthHeaderProvider } from './header/AuthHeaderProvider' ;
@@ -294,10 +294,10 @@ export default class Registration extends React.Component<IProps, IState> {
294294 ) ;
295295 } ;
296296
297- private onUIAuthFinished = async ( success : boolean , response : any ) => {
297+ private onUIAuthFinished : InteractiveAuthCallback = async ( success , response ) => {
298298 debuglog ( "Registration: ui authentication finished: " , { success, response } ) ;
299299 if ( ! success ) {
300- let errorText = response . message || response . toString ( ) ;
300+ let errorText : ReactNode = response . message || response . toString ( ) ;
301301 // can we give a better error message?
302302 if ( response . errcode === 'M_RESOURCE_LIMIT_EXCEEDED' ) {
303303 const errorTop = messageForResourceLimitError (
@@ -320,10 +320,10 @@ export default class Registration extends React.Component<IProps, IState> {
320320 < p > { errorTop } </ p >
321321 < p > { errorDetail } </ p >
322322 </ div > ;
323- } else if ( response . required_stages && response . required_stages . indexOf ( 'm.login.msisdn' ) > - 1 ) {
323+ } else if ( response . required_stages && response . required_stages . indexOf ( AuthType . Msisdn ) > - 1 ) {
324324 let msisdnAvailable = false ;
325325 for ( const flow of response . available_flows ) {
326- msisdnAvailable = msisdnAvailable || flow . stages . includes ( 'm.login.msisdn' ) ;
326+ msisdnAvailable = msisdnAvailable || flow . stages . includes ( AuthType . Msisdn ) ;
327327 }
328328 if ( ! msisdnAvailable ) {
329329 errorText = _t ( 'This server does not support authentication with a phone number.' ) ;
0 commit comments