<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\AuthController;

Route::get('/user', function (Request $request) {
    return $request->user();
})->middleware('auth:sanctum');




// 1. Public Route
Route::get('/test', [AuthController::class, 'index']);

// 2. Authentication Route (to get token)
Route::post('/login', [AuthController::class, 'login']);

Route::post('/sso/validate', [App\Http\Controllers\SsoController::class, 'validateToken']);

// 3. Protected Route (Requires a valid Bearer token)
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();


});