api_actualizacion
This commit is contained in:
parent
84b4d80cd2
commit
76c606bd36
@ -7,7 +7,6 @@
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
public function register(Request $request){
|
public function register(Request $request){
|
||||||
@ -41,19 +40,19 @@ public function login(Request $request){
|
|||||||
if(Hash::check($request->password, $user->password)){
|
if(Hash::check($request->password, $user->password)){
|
||||||
$token = $user->createToken("auth_token")->plainTextToken;
|
$token = $user->createToken("auth_token")->plainTextToken;
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"msg" => "Usuario logueado",
|
"message" => "Usuario logueado",
|
||||||
"access_token" => $token
|
"access_token" => $token
|
||||||
]);
|
]);
|
||||||
}else{
|
}else{
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"msg" => "La password es incorrecta",
|
"message" => "La password es incorrecta",
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"status" => 0,
|
"status" => 0,
|
||||||
"msg" => "Usuario no registrado",
|
"message" => "Usuario no registrado",
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,7 +60,7 @@ public function login(Request $request){
|
|||||||
public function userProfile(){
|
public function userProfile(){
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"status" => 0,
|
"status" => 0,
|
||||||
"msg" => "Perfil de usuario",
|
"message" => "Perfil de usuario",
|
||||||
"data" => auth()->user()
|
"data" => auth()->user()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -70,7 +69,7 @@ public function logout(){
|
|||||||
auth()->user()->tokens()->delete();
|
auth()->user()->tokens()->delete();
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"status" => 1,
|
"status" => 1,
|
||||||
"msg" => "Cierre de Sesión",
|
"message" => "Cierre de Sesión",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'America/Lima',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user