@@ -104,19 +104,21 @@ const Settings: NextPage = () => {
104104 setChangedFlow ( initialFlow )
105105
106106 //prevent password change option display if sso
107- if ( [ "microsoft" , "google" ] . includes ( initialFlow . identity . metadata_public ?. registration_scope ?. provider_id ) ) {
108- initialFlow . ui . nodes = initialFlow . ui . nodes . filter ( ( node : UiNode ) => node . group !== "password" ) ;
109- setIsOidc ( true ) ;
110- if ( initialFlow . identity . metadata_public ?. registration_scope ?. invitation_sso ) {
111- setIsOidcInvitation ( true ) ;
112- }
113- const provider = initialFlow . identity . metadata_public ?. registration_scope ?. provider_id ;
114- if ( provider === "google" ) {
115- document . querySelector ( 'button[value="Microsoft"]' ) ?. setAttribute ( "class" , "hidden" ) ;
116- } else if ( provider === "microsoft" ) {
117- document . querySelector ( 'button[value="Google"]' ) ?. setAttribute ( "class" , "hidden" ) ;
107+ requestAnimationFrame ( ( ) => {
108+ if ( [ "microsoft" , "google" ] . includes ( initialFlow . identity . metadata_public ?. registration_scope ?. provider_id ) ) {
109+ initialFlow . ui . nodes = initialFlow . ui . nodes . filter ( ( node : UiNode ) => node . group !== "password" ) ;
110+ setIsOidc ( true ) ;
111+ if ( initialFlow . identity . metadata_public ?. registration_scope ?. invitation_sso ) {
112+ setIsOidcInvitation ( true ) ;
113+ }
114+ const provider = initialFlow . identity . metadata_public ?. registration_scope ?. provider_id ;
115+ if ( provider === "google" ) {
116+ document . querySelector ( 'button[value="Microsoft"]' ) ?. setAttribute ( "class" , "hidden" ) ;
117+ } else if ( provider === "microsoft" ) {
118+ document . querySelector ( 'button[value="Google"]' ) ?. setAttribute ( "class" , "hidden" ) ;
119+ }
118120 }
119- }
121+ } ) ;
120122 } , [ initialFlow ] )
121123
122124 useEffect ( ( ) => {
0 commit comments