mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 21:57:47 +02:00
All hardcoded strings replaced by i18n translation
This commit is contained in:
@ -23,19 +23,14 @@ class QrCodecontroller extends Controller
|
||||
{
|
||||
|
||||
// input validation
|
||||
$messages = [
|
||||
'qrcode.image' => 'Supported format are jpeg, png, bmp, gif, svg, or webp'
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'qrcode' => 'required|image',
|
||||
], $messages);
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json(['error' => $validator->errors()], 400);
|
||||
}
|
||||
|
||||
|
||||
// qrcode analysis
|
||||
$path = $request->file('qrcode')->store('qrcodes');
|
||||
$qrcode = new QrReader(storage_path('app/' . $path));
|
||||
@ -71,7 +66,7 @@ class QrCodecontroller extends Controller
|
||||
|
||||
return response()->json([
|
||||
'error' => [
|
||||
'qrcode' => 'No valid TOTP resource in this QR code'
|
||||
'qrcode' => __('errors.response.no_valid_totp')
|
||||
]
|
||||
], 400);
|
||||
|
||||
|
Reference in New Issue
Block a user