Complete exception handling

This commit is contained in:
Bubka 2020-11-05 22:54:06 +01:00
parent 544e916d60
commit 67fa859b2a
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@
namespace App;
use Exception;
use OTPHP\HOTP;
use OTPHP\Factory;
use App\Classes\Options;
@ -10,7 +11,6 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Contracts\Encryption\DecryptException;
class TwoFAccount extends Model implements Sortable
{
@ -193,7 +193,7 @@ public function getUriAttribute($value)
try {
return Crypt::decryptString($value);
}
catch (DecryptException $e) {
catch (Exception $e) {
return '*encrypted*';
}
}
@ -227,7 +227,7 @@ public function getAccountAttribute($value)
try {
return Crypt::decryptString($value);
}
catch (DecryptException $e) {
catch (Exception $e) {
return '*encrypted*';
}
}

View File

@ -136,6 +136,9 @@
}, 1000);
})
.catch(error => {
this.$router.push({ name: 'genericError', params: { err: error.response } });
});
},
getHOTP: function() {
@ -148,6 +151,9 @@
this.next_uri = response.data.nextUri
})
.catch(error => {
this.$router.push({ name: 'genericError', params: { err: error.response } });
});
},
clearOTP: function() {