@@ -166,7 +166,7 @@ export class UALProvider extends Component {
166166 const users = await authenticator . login ( )
167167 const accountName = await users [ 0 ] . getAccountName ( )
168168 if ( ! isAutoLogin ) {
169- window . localStorage . setItem ( 'UALLoggedInAuthType' , authenticator . constructor . name )
169+ window . localStorage . setItem ( 'UALLoggedInAuthType' , authenticator . getName ( ) )
170170 this . setUALInvalidateAt ( authenticator )
171171 }
172172 broadcastStatus ( {
@@ -194,7 +194,6 @@ export class UALProvider extends Component {
194194 */
195195 submitAccountForLogin : async ( accountInput , authenticator ) => {
196196 const { broadcastStatus } = this . state
197- const authenticatorName = authenticator . constructor . name
198197 broadcastStatus ( {
199198 loading : true ,
200199 message : authenticator . requiresGetKeyConfirmation ( )
@@ -203,7 +202,7 @@ export class UALProvider extends Component {
203202 } )
204203 try {
205204 const users = await authenticator . login ( accountInput )
206- window . localStorage . setItem ( 'UALLoggedInAuthType' , authenticatorName )
205+ window . localStorage . setItem ( 'UALLoggedInAuthType' , authenticator . getName ( ) )
207206 window . localStorage . setItem ( 'UALAccountName' , accountInput )
208207 broadcastStatus ( {
209208 activeUser : users [ users . length - 1 ] ,
@@ -276,7 +275,7 @@ export class UALProvider extends Component {
276275 * @return {number|boolean }
277276 */
278277 getAuthenticatorInstance = ( type , availableAuthenticators ) => {
279- const loggedIn = availableAuthenticators . filter ( auth => auth . constructor . name === type )
278+ const loggedIn = availableAuthenticators . filter ( auth => auth . getName ( ) === type )
280279 if ( ! loggedIn . length ) {
281280 this . clearCache ( )
282281 }
0 commit comments