Skip to content

Commit

Permalink
Merge pull request #83 from snypy/fix-admin-csrf
Browse files Browse the repository at this point in the history
Add config option for csrf trusted origins
  • Loading branch information
nezhar authored May 11, 2022
2 parents b003aba + 691977b commit 8ac26b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ DEBUG=True
SECRET_KEY=changeme!
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ORIGIN_WHITELIST=http://localhost,http://127.0.0.1
CSRF_TRUSTED_ORIGINS=http://localhost,http://127.0.0.1
REGISTER_VERIFICATION_URL=http://localhost:4200/verify-user/
RESET_PASSWORD_VERIFICATION_URL=http://localhost:4200/reset-password/
REGISTER_EMAIL_VERIFICATION_URL=http://localhost:4200/verify-email/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
ALLOWED_HOSTS: localhost,127.0.0.1
DATABASE_URL: sqlite:////tmp/db.sqlite3
CORS_ORIGIN_WHITELIST: "http://localhost,http://127.0.0.1"
CSRF_TRUSTED_ORIGINS: "http://localhost"
REGISTER_VERIFICATION_URL: "http://localhost:4200/verify-user/"
RESET_PASSWORD_VERIFICATION_URL: "http://localhost:4200/reset-password/"
REGISTER_EMAIL_VERIFICATION_URL: "http://localhost:4200/verify-email/"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
ALLOWED_HOSTS: localhost,127.0.0.1
DATABASE_URL: sqlite:////tmp/db.sqlite3
CORS_ORIGIN_WHITELIST: "http://localhost,http://127.0.0.1"
CSRF_TRUSTED_ORIGINS: "http://localhost"
REGISTER_VERIFICATION_URL: "http://localhost:4200/verify-user/"
RESET_PASSWORD_VERIFICATION_URL: "http://localhost:4200/reset-password/"
REGISTER_EMAIL_VERIFICATION_URL: "http://localhost:4200/verify-email/"
Expand Down
1 change: 1 addition & 0 deletions snypy/snypy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
DEBUG = env("DEBUG")

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS")

# Application definition

Expand Down

0 comments on commit 8ac26b3

Please sign in to comment.