from fastapi import FastAPI, APIRouter, Depends, Request, HTTPException, Form
from fastapi.templating import Jinja2Templates
from fastapi.responses import RedirectResponse, HTMLResponse
from fastapi.responses import JSONResponse
import jwt


from routers.auth import get_current_user

router = APIRouter()
templates = Jinja2Templates(directory="templates")

@router.get("/")
async def home(request: Request, username: dict = Depends(get_current_user)):
    size = "Dashboard"
    username = username
    
    return templates.TemplateResponse("index.html", {"request": request, "size": size, "role": username["role"], "username": username['username'], "current_path": request.url.path })#


