mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-08 21:44:32 +02:00
Push to Error view when ProtectDB option fail
This commit is contained in:
@ -33,19 +33,22 @@ class OptionController extends Controller
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user