auth fix
This commit is contained in:
parent
2b0ebbda53
commit
8c2169c2d6
|
|
@ -67,14 +67,14 @@ class AuthController extends Controller
|
|||
public function login(Request $request){
|
||||
$data = $request->all();
|
||||
$rules= [
|
||||
'email'=>'required',
|
||||
'email'=>'required|email',
|
||||
'password' => 'required'
|
||||
];
|
||||
|
||||
$validator = Validator::make($data, $rules);
|
||||
|
||||
if($validator->fails()){
|
||||
return response()->json(['message' => 'validation failed' ,'errors'=>$validator->errors()]);
|
||||
return response()->json(['message' => 'validation failed' ,'errors'=>$validator->errors()],422);
|
||||
}
|
||||
|
||||
$client = Client::where('email', request()->email)->first();
|
||||
|
|
@ -149,14 +149,14 @@ public function register(Request $request){
|
|||
$validator = Validator::make($data, $rules);
|
||||
|
||||
if($validator->fails()){
|
||||
return response()->json(['message' => 'validation failed' ,'errors'=>$validator->errors()]);
|
||||
return response()->json(['message' => 'validation failed' ,'errors'=>$validator->errors()],422);
|
||||
}
|
||||
|
||||
$data = $request->all();
|
||||
|
||||
$data['password'] = Hash::make($data['password']);
|
||||
|
||||
$email_verification = Config::get('settings.email_verification');
|
||||
$email_verification = (bool) Config::get('settings.email_verification');
|
||||
$data['is_verified'] = $email_verification;
|
||||
|
||||
$data['token'] = rand(1000, 9999);//generate code;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.0.14",
|
||||
"php": "^8.0.9",
|
||||
"backpack/crud": "^5.0",
|
||||
"backpack/filemanager": "^2.0",
|
||||
"backpack/langfilemanager": "^4.1",
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
"name": "backpack/crud",
|
||||
"version": "5.1.2",
|
||||
"source": {
|
||||
"type": "zip",
|
||||
"url": "./CRUD.zip",
|
||||
"type": "git",
|
||||
"url": "https://github.com/Laravel-Backpack/CRUD.git",
|
||||
"reference": "a15f93a784e8d130f5ea5c3341fb7bca1f3c25e3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "file:///var/www/birzha-legalizasia/CRUD-5.zip",
|
||||
"type": "git",
|
||||
"url": "https://github.com/Laravel-Backpack/CRUD.git",
|
||||
"reference": "a15f93a784e8d130f5ea5c3341fb7bca1f3c25e3",
|
||||
"shasum": ""
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue