<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Auth;

class GetUserController extends Controller
{
    function getUser(){
        if(Auth::check()){
            $user = Auth::user();
            return response()->json($user);
        }
        return response()->json(['error' => 'Unauthorized'], 401);
    }
}
