Skip to content

Commit

Permalink
improve sanctum stateful url setup and add default origin policy header
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilReinking committed Apr 18, 2024
1 parent bd000e8 commit e2343d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/sanctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'::1,localhost:8500,localhost:8080,127.0.0.1:8500,127.0.0.1:8080',
env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
'::1,127.0.0.1:8500,localhost:8500,localhost:8080,127.0.0.1:8080',
env('APP_URL') ? ',' . (parse_url(env('APP_URL'), PHP_URL_PORT) ? parse_url(env('APP_URL'), PHP_URL_HOST) . ':' . parse_url(env('APP_URL'), PHP_URL_PORT) : parse_url(env('APP_URL'), PHP_URL_HOST)) : ''
))),

/*
Expand Down
2 changes: 2 additions & 0 deletions nginx.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ server {

client_max_body_size 8M;

add_header Referrer-Policy 'origin';

location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.php
Expand Down

0 comments on commit e2343d9

Please sign in to comment.