暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. use Laravel\Sanctum\Sanctum;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Stateful Domains
  7. |--------------------------------------------------------------------------
  8. |
  9. | Requests from the following domains / hosts will receive stateful API
  10. | authentication cookies. Typically, these should include your local
  11. | and production domains which access your API via a frontend SPA.
  12. |
  13. */
  14. 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
  15. '%s%s',
  16. 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
  17. Sanctum::currentApplicationUrlWithPort()
  18. ))),
  19. /*
  20. |--------------------------------------------------------------------------
  21. | Sanctum Guards
  22. |--------------------------------------------------------------------------
  23. |
  24. | This array contains the authentication guards that will be checked when
  25. | Sanctum is trying to authenticate a request. If none of these guards
  26. | are able to authenticate the request, Sanctum will use the bearer
  27. | token that's present on an incoming request for authentication.
  28. |
  29. */
  30. 'guard' => ['web'],
  31. /*
  32. |--------------------------------------------------------------------------
  33. | Expiration Minutes
  34. |--------------------------------------------------------------------------
  35. |
  36. | This value controls the number of minutes until an issued token will be
  37. | considered expired. This will override any values set in the token's
  38. | "expires_at" attribute, but first-party sessions are not affected.
  39. |
  40. */
  41. 'expiration' => null,
  42. /*
  43. |--------------------------------------------------------------------------
  44. | Token Prefix
  45. |--------------------------------------------------------------------------
  46. |
  47. | Sanctum can prefix new tokens in order to take advantage of numerous
  48. | security scanning initiatives maintained by open source platforms
  49. | that notify developers if they commit tokens into repositories.
  50. |
  51. | See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
  52. |
  53. */
  54. 'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
  55. /*
  56. |--------------------------------------------------------------------------
  57. | Sanctum Middleware
  58. |--------------------------------------------------------------------------
  59. |
  60. | When authenticating your first-party SPA with Sanctum you may need to
  61. | customize some of the middleware Sanctum uses while processing the
  62. | request. You may change the middleware listed below as required.
  63. |
  64. */
  65. 'middleware' => [
  66. 'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
  67. 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
  68. 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
  69. ],
  70. ];