@@ -21,6 +21,7 @@ import * as sdk from './index';
2121import Modal from './Modal' ;
2222import { _t } from './languageHandler' ;
2323import IdentityAuthClient from './IdentityAuthClient' ;
24+ import { SSOAuthEntry } from "./components/views/auth/InteractiveAuthEntryComponents" ;
2425
2526function getIdServerDomain ( ) {
2627 return MatrixClientPeg . get ( ) . idBaseUrl . split ( "://" ) [ 1 ] ;
@@ -188,11 +189,31 @@ export default class AddThreepid {
188189 // pop up an interactive auth dialog
189190 const InteractiveAuthDialog = sdk . getComponent ( "dialogs.InteractiveAuthDialog" ) ;
190191
192+
193+ const dialogAesthetics = {
194+ [ SSOAuthEntry . PHASE_PREAUTH ] : {
195+ title : _t ( "Use Single Sign On to continue" ) ,
196+ body : _t ( "Confirm adding this email address by using " +
197+ "Single Sign On to prove your identity." ) ,
198+ continueText : _t ( "Single Sign On" ) ,
199+ continueKind : "primary" ,
200+ } ,
201+ [ SSOAuthEntry . PHASE_POSTAUTH ] : {
202+ title : _t ( "Confirm adding email" ) ,
203+ body : _t ( "Click the button below to confirm adding this email address." ) ,
204+ continueText : _t ( "Confirm" ) ,
205+ continueKind : "primary" ,
206+ } ,
207+ } ;
191208 const { finished } = Modal . createTrackedDialog ( 'Add Email' , '' , InteractiveAuthDialog , {
192209 title : _t ( "Add Email Address" ) ,
193210 matrixClient : MatrixClientPeg . get ( ) ,
194211 authData : e . data ,
195212 makeRequest : this . _makeAddThreepidOnlyRequest ,
213+ aestheticsForStagePhases : {
214+ [ SSOAuthEntry . LOGIN_TYPE ] : dialogAesthetics ,
215+ [ SSOAuthEntry . UNSTABLE_LOGIN_TYPE ] : dialogAesthetics ,
216+ } ,
196217 } ) ;
197218 return finished ;
198219 }
@@ -285,11 +306,30 @@ export default class AddThreepid {
285306 // pop up an interactive auth dialog
286307 const InteractiveAuthDialog = sdk . getComponent ( "dialogs.InteractiveAuthDialog" ) ;
287308
309+ const dialogAesthetics = {
310+ [ SSOAuthEntry . PHASE_PREAUTH ] : {
311+ title : _t ( "Use Single Sign On to continue" ) ,
312+ body : _t ( "Confirm adding this phone number by using " +
313+ "Single Sign On to prove your identity." ) ,
314+ continueText : _t ( "Single Sign On" ) ,
315+ continueKind : "primary" ,
316+ } ,
317+ [ SSOAuthEntry . PHASE_POSTAUTH ] : {
318+ title : _t ( "Confirm adding phone number" ) ,
319+ body : _t ( "Click the button below to confirm adding this phone number." ) ,
320+ continueText : _t ( "Confirm" ) ,
321+ continueKind : "primary" ,
322+ } ,
323+ } ;
288324 const { finished } = Modal . createTrackedDialog ( 'Add MSISDN' , '' , InteractiveAuthDialog , {
289325 title : _t ( "Add Phone Number" ) ,
290326 matrixClient : MatrixClientPeg . get ( ) ,
291327 authData : e . data ,
292328 makeRequest : this . _makeAddThreepidOnlyRequest ,
329+ aestheticsForStagePhases : {
330+ [ SSOAuthEntry . LOGIN_TYPE ] : dialogAesthetics ,
331+ [ SSOAuthEntry . UNSTABLE_LOGIN_TYPE ] : dialogAesthetics ,
332+ } ,
293333 } ) ;
294334 return finished ;
295335 }
0 commit comments