@@ -15,10 +15,9 @@ import { task, timeout } from 'ember-concurrency';
1515const TOKEN_SEPARATOR = '☃' ;
1616const TOKEN_PREFIX = 'vault-' ;
1717const ROOT_PREFIX = '_root_' ;
18- const TOTP_NOT_CONFIGURED = 'TOTP mfa required but not configured' ;
1918const BACKENDS = supportedAuthBackends ( ) ;
2019
21- export { TOKEN_SEPARATOR , TOKEN_PREFIX , ROOT_PREFIX , TOTP_NOT_CONFIGURED } ;
20+ export { TOKEN_SEPARATOR , TOKEN_PREFIX , ROOT_PREFIX } ;
2221
2322export default Service . extend ( {
2423 permissions : service ( ) ,
@@ -362,21 +361,10 @@ export default Service.extend({
362361 async authenticate ( /*{clusterId, backend, data}*/ ) {
363362 const [ options ] = arguments ;
364363 const adapter = this . clusterAdapter ( ) ;
365- let resp ;
366-
367- try {
368- resp = await adapter . authenticate ( options ) ;
369- } catch ( e ) {
370- // TODO: check for totp not configured mfa error before throwing
371- const errors = this . handleError ( e ) ;
372- // stubbing error - verify once API is finalized
373- if ( errors . includes ( TOTP_NOT_CONFIGURED ) ) {
374- this . set ( 'mfaErrors' , errors ) ;
375- }
376- throw e ;
377- }
378364
365+ let resp = await adapter . authenticate ( options ) ;
379366 const { mfa_requirement, requiresAction } = this . _parseMfaResponse ( resp . auth ?. mfa_requirement ) ;
367+
380368 if ( mfa_requirement ) {
381369 if ( requiresAction ) {
382370 return { mfa_requirement } ;
0 commit comments