Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
version="1.0.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Improvement: While replacing the wildcard CORS origin with a specific domain is a good security improvement, hardcoding the frontend URL (https://bubblesort.vercel.com) limits deployment flexibility. Consider using environment variables instead:

origins = os.getenv('ALLOWED_ORIGINS', 'https://bubblesort.vercel.com').split(',')

This would allow for different frontend URLs across environments without code changes.

)

# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Configure this properly for production
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

# Include authentication routes
app.include_router(auth_router)

Expand Down Expand Up @@ -51,4 +42,4 @@ async def root():
"auth": "/auth",
"protected": "/protected"
}
}
}