from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT
from fastapi_jwt_auth.exceptions import AuthJWTException

from .core.settings import settings
from .routers.api import router


@AuthJWT.load_config
def get_config():
    return settings


app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=settings.ORIGINS,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={"detail": exc.message})


app.include_router(router)

ea29d50fe26eb4ff0f496c757af67bec70493bbf
<mask token>


@AuthJWT.load_config
def get_config():
    return settings


<mask token>


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={'detail': exc
        .message})


<mask token>

<mask token>


@AuthJWT.load_config
def get_config():
    return settings


<mask token>
app.add_middleware(CORSMiddleware, allow_origins=settings.ORIGINS,
    allow_credentials=True, allow_methods=['*'], allow_headers=['*'])


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={'detail': exc
        .message})


app.include_router(router)

<mask token>


@AuthJWT.load_config
def get_config():
    return settings


app = FastAPI()
app.add_middleware(CORSMiddleware, allow_origins=settings.ORIGINS,
    allow_credentials=True, allow_methods=['*'], allow_headers=['*'])


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={'detail': exc
        .message})


app.include_router(router)

from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT
from fastapi_jwt_auth.exceptions import AuthJWTException
from .core.settings import settings
from .routers.api import router


@AuthJWT.load_config
def get_config():
    return settings


app = FastAPI()
app.add_middleware(CORSMiddleware, allow_origins=settings.ORIGINS,
    allow_credentials=True, allow_methods=['*'], allow_headers=['*'])


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={'detail': exc
        .message})


app.include_router(router)

from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT
from fastapi_jwt_auth.exceptions import AuthJWTException

from .core.settings import settings
from .routers.api import router


@AuthJWT.load_config
def get_config():
    return settings


app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=settings.ORIGINS,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)


@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
    return JSONResponse(status_code=exc.status_code, content={"detail": exc.message})


app.include_router(router)
