mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-23 22:01:49 +01:00
Complete exception handling
This commit is contained in:
parent
544e916d60
commit
67fa859b2a
@ -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*';
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user