Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into separate-frontend-bac…
Browse files Browse the repository at this point in the history
…kend
  • Loading branch information
mnida committed Oct 10, 2022
2 parents 9a4c274 + 587566e commit a9b4c01
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
24 changes: 23 additions & 1 deletion backend/lotus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"django.contrib.staticfiles",
"rest_framework",
"metering_billing",
"corsheaders",
"social_django",
"djmoney",
"django_extensions",
Expand Down Expand Up @@ -351,9 +352,30 @@

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

CORS_ORIGIN_ALLOW_ALL = True
if DEBUG:
CORS_ALLOW_ALL_ORIGINS = True
else:
CORS_ALLOWED_ORIGINS = [
"https://app.uselotus.io",
"https://www.uselotus.app",
"https://staging.uselotus.io",
]
CORS_ALLOW_CREDENTIALS = True

CORS_ALLOW_HEADERS = [
"accept",
"accept-encoding",
"authorization",
"content-type",
"dnt",
"origin",
"user-agent",
"x-csrftoken",
"x-requested-with",
"x-api-key",
"X-API-KEY",
]

CSRF_COOKIE_SAMESITE = "Lax"
SESSION_COOKIE_SAMESITE = "Lax"
CSRF_COOKIE_HTTPONLY = False
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/.env.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NODE_ENV=production
VITE_APP_NAME=Lotus-Frontend
VITE_API_URL="https://uselotus.app/"
VITE_API_URL="https://api.uselotus.io/"
VITE_STRIPE_CLIENT="ca_MFoUGxeAu02Kb2P1p252evCcWnroWl7S"
1 change: 1 addition & 0 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CreateOrgAccountType } from "../types/account-type";
import { cancelSubscriptionType } from "../components/Customers/CustomerSubscriptionView";
import { FeatureType } from "../types/feature-type";

axios.defaults.baseURL = import.meta.env.VITE_API_URL;
axios.defaults.xsrfCookieName = "csrftoken";
axios.defaults.xsrfHeaderName = "X-CSRFToken";

Expand Down

0 comments on commit a9b4c01

Please sign in to comment.