mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-02 11:39:19 +01:00
Push to Error view when ProtectDB option fail
This commit is contained in:
parent
d1d4734031
commit
289a208847
@ -33,19 +33,22 @@ public function store(Request $request)
|
||||
// The useEncryption option impacts the [existing] content of the database.
|
||||
// Encryption/Decryption of the data is done only if the user change the value of the option
|
||||
// to prevent successive encryption
|
||||
|
||||
if( $request->useEncryption && !Options::get('useEncryption') ) {
|
||||
|
||||
// user enabled the encryption
|
||||
if( !DbProtection::enable() ) {
|
||||
return response()->json(['message' => __('errors.error_during_encryption'), 'settings' => Options::get()], 422);
|
||||
if( isset($request->useEncryption))
|
||||
{
|
||||
if( $request->useEncryption && !Options::get('useEncryption') ) {
|
||||
|
||||
// user enabled the encryption
|
||||
if( !DbProtection::enable() ) {
|
||||
return response()->json(['message' => __('errors.error_during_encryption'), 'settings' => Options::get()], 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( !$request->useEncryption && Options::get('useEncryption') ) {
|
||||
else if( !$request->useEncryption && Options::get('useEncryption') ) {
|
||||
|
||||
// user disabled the encryption
|
||||
if( !DbProtection::disable() ) {
|
||||
return response()->json(['message' => __('errors.error_during_decryption'), 'settings' => Options::get()], 422);
|
||||
// user disabled the encryption
|
||||
if( !DbProtection::disable() ) {
|
||||
return response()->json(['message' => __('errors.error_during_decryption'), 'settings' => Options::get()], 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
||||
handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
|
||||
this.form.post('/api/settings/options', {returnError: true})
|
||||
this.form.post('/api/settings/options', {returnError: false})
|
||||
.then(response => {
|
||||
|
||||
this.$notify({ type: 'is-success', text: response.data.message })
|
||||
@ -91,10 +91,6 @@
|
||||
else {
|
||||
this.$root.appSettings = response.data.settings
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
this.$notify({ type: 'is-danger', text: error.response.data.message })
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
'Unable_to_decrypt_uri' => 'Unable to decrypt uri',
|
||||
'not_a_supported_otp_type' => 'This OTP format is not currently supported',
|
||||
'wrong_current_password' => 'Wrong current password, nothing has changed',
|
||||
'error_during_encryption' => 'Encryption failed, your database remains unprotected',
|
||||
'error_during_decryption' => 'Decryption failed, your database is still protected',
|
||||
'error_during_encryption' => 'Encryption failed, your database remains unprotected.',
|
||||
'error_during_decryption' => 'Decryption failed, your database is still protected. This is mainly caused by an integrity issue of encrypted data for one or more accounts.',
|
||||
|
||||
];
|
Loading…
Reference in New Issue
Block a user