mirror of https://github.com/Bunsly/JobSpy
feat: optional auth
parent
aeb2b34618
commit
4144562053
|
@ -1,6 +1,11 @@
|
||||||
from fastapi import APIRouter, Depends
|
from fastapi import APIRouter, Depends
|
||||||
from .jobs import router as jobs_router
|
from .jobs import router as jobs_router
|
||||||
from api.auth.auth_utils import get_active_current_user
|
from api.auth.auth_utils import get_active_current_user
|
||||||
|
from settings import AUTH_REQUIRED
|
||||||
|
|
||||||
|
if AUTH_REQUIRED:
|
||||||
|
router = APIRouter(prefix="/v1", dependencies=[Depends(get_active_current_user)])
|
||||||
|
else:
|
||||||
|
router = APIRouter(prefix="/v1")
|
||||||
|
|
||||||
router = APIRouter(prefix="/v1", dependencies=[Depends(get_active_current_user)])
|
|
||||||
router.include_router(jobs_router)
|
router.include_router(jobs_router)
|
||||||
|
|
|
@ -7,3 +7,4 @@ SUPABASE_KEY = os.environ.get("SUPABASE_KEY")
|
||||||
JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY")
|
JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY")
|
||||||
ALGORITHM = "HS256"
|
ALGORITHM = "HS256"
|
||||||
ACCESS_TOKEN_EXPIRE_MINUTES = 60
|
ACCESS_TOKEN_EXPIRE_MINUTES = 60
|
||||||
|
AUTH_REQUIRED = False
|
||||||
|
|
Loading…
Reference in New Issue