mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
Merge pull request #459 from MODSetter/dev
feat: add BACKEND_URL configuration for OAuth redirect
This commit is contained in:
commit
7a0dc0efdc
2 changed files with 10 additions and 0 deletions
|
|
@ -68,6 +68,14 @@ if config.AUTH_TYPE == "GOOGLE":
|
||||||
app.include_router(
|
app.include_router(
|
||||||
fastapi_users.get_oauth_router(
|
fastapi_users.get_oauth_router(
|
||||||
google_oauth_client, auth_backend, SECRET, is_verified_by_default=True
|
google_oauth_client, auth_backend, SECRET, is_verified_by_default=True
|
||||||
|
)
|
||||||
|
if not config.BACKEND_URL
|
||||||
|
else fastapi_users.get_oauth_router(
|
||||||
|
google_oauth_client,
|
||||||
|
auth_backend,
|
||||||
|
SECRET,
|
||||||
|
is_verified_by_default=True,
|
||||||
|
redirect_url=f"{config.BACKEND_URL}/auth/google/callback",
|
||||||
),
|
),
|
||||||
prefix="/auth/google",
|
prefix="/auth/google",
|
||||||
tags=["auth"],
|
tags=["auth"],
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,8 @@ class Config:
|
||||||
DATABASE_URL = os.getenv("DATABASE_URL")
|
DATABASE_URL = os.getenv("DATABASE_URL")
|
||||||
|
|
||||||
NEXT_FRONTEND_URL = os.getenv("NEXT_FRONTEND_URL")
|
NEXT_FRONTEND_URL = os.getenv("NEXT_FRONTEND_URL")
|
||||||
|
# Backend URL to override the http to https in the OAuth redirect URI
|
||||||
|
BACKEND_URL = os.getenv("BACKEND_URL")
|
||||||
|
|
||||||
# Auth
|
# Auth
|
||||||
AUTH_TYPE = os.getenv("AUTH_TYPE")
|
AUTH_TYPE = os.getenv("AUTH_TYPE")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue