login
This commit is contained in:
@@ -3,12 +3,44 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
//use Illuminate\Validation\Validator;
|
||||
use Validator;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
//
|
||||
public function login(Request $req){
|
||||
|
||||
return [];
|
||||
$rules = array(
|
||||
"username"=>"required",
|
||||
"password"=>"required"
|
||||
);
|
||||
$validator = Validator::make( $req->all(), $rules);
|
||||
if ( $validator->fails()){
|
||||
return response()->json($validator->errors(),401);
|
||||
}
|
||||
|
||||
$allwApi = ['ameye@chiefsoft.com','support@wrenchboard.com','ses66181@gmail.com'];
|
||||
$username = $req->username;
|
||||
$password = $req->password;
|
||||
|
||||
$lm = "just started";
|
||||
$lresult =[];
|
||||
if (in_array($username, $allwApi, true) && $password =='1234567890') {
|
||||
$lm = "$username found with strict check";
|
||||
$lresult = [
|
||||
"profile" =>[
|
||||
"firstname" => "admin",
|
||||
"lastname" => "admin2",
|
||||
"email" => "admin@admin.com",
|
||||
"added" => "10-10-2023",
|
||||
"last_login" => "10-10-2021",
|
||||
"uid" => "79ca8829-cd03-4786-8e80-75d3ab4c34fb"
|
||||
],
|
||||
"token"=> 'aac93629-a2c6-43ae-991f-149e796a3c76'
|
||||
];
|
||||
}
|
||||
|
||||
return $lresult;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user