mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
fix: ran linting for both backend and frontend
This commit is contained in:
parent
19ed0becce
commit
fd94193fd5
2 changed files with 20 additions and 14 deletions
|
|
@ -17,11 +17,15 @@ async def lifespan(app: FastAPI):
|
|||
await create_db_and_tables()
|
||||
yield
|
||||
|
||||
|
||||
def registration_allowed():
|
||||
if not config.REGISTRATION_ENABLED:
|
||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Registration is disabled")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN, detail="Registration is disabled"
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
# Add CORS middleware
|
||||
|
|
@ -67,7 +71,9 @@ if config.AUTH_TYPE == "GOOGLE":
|
|||
),
|
||||
prefix="/auth/google",
|
||||
tags=["auth"],
|
||||
dependencies=[Depends(registration_allowed)], # blocks OAuth registration when disabled
|
||||
dependencies=[
|
||||
Depends(registration_allowed)
|
||||
], # blocks OAuth registration when disabled
|
||||
)
|
||||
|
||||
app.include_router(crud_router, prefix="/api/v1", tags=["crud"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue