Skip to content

Commit 32e6bf2

Browse files
committed
Merge branch 'fix/missing-videos'
2 parents 3eaa6f7 + 1ee2ab0 commit 32e6bf2

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

mp4/csrf-mismatch-modal.mp4

58.9 KB
Binary file not shown.

mp4/csrf-mismatch-warning.mp4

77.4 KB
Binary file not shown.

v1/advanced/csrf-protection.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ The easiest way to implement this is using server-side middleware. Simply includ
7474

7575
When a CSRF token mismatch occurs, your server-side framework will likely throw an exception that results in an error response. For example, when using Laravel, a `TokenMismatchException` is thrown which results in a `419` error page. Since that isn't a valid Inertia response, the error is shown in a modal.
7676

77-
<video controls=""><source src="/mp4/csrf-mismatch-modal.mp4" type="video/mp4"></source></video>Obviously, this isn't a great user experience. A better way to handle these errors is to return a redirect back to the previous page, along with a flash message that the page expired. This will result in a valid Inertia response with the flash message available as a prop which you can then display to the user. Of course, you'll need to share your [flash messages](/shared-data#flash-messages) with Inertia for this to work.
77+
<video controls><source src="/mp4/csrf-mismatch-modal.mp4" type="video/mp4"></source></video>
78+
79+
Obviously, this isn't a great user experience. A better way to handle these errors is to return a redirect back to the previous page, along with a flash message that the page expired. This will result in a valid Inertia response with the flash message available as a prop which you can then display to the user. Of course, you'll need to share your [flash messages](/shared-data#flash-messages) with Inertia for this to work.
7880

7981
When using Laravel, you may modify your application's exception handler to automatically redirect the user back to the page they were previously on while flashing a message to the session. To accomplish this, you may use the `respond` exception method in your application's `bootstrap/app.php` file.
8082

@@ -96,4 +98,4 @@ use Symfony\Component\HttpFoundation\Response;
9698

9799
The end result is a much better experience for your users. Instead of seeing the error modal, the user is instead presented with a message that the page "expired" and are asked to try again.
98100

99-
<video controls=""><source src="/mp4/csrf-mismatch-warning.mp4" type="video/mp4"></source></video>
101+
<video controls><source src="/mp4/csrf-mismatch-warning.mp4" type="video/mp4"></source></video>

v2/security/csrf-protection.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ The easiest way to implement this is using server-side middleware. Simply includ
6262

6363
When a CSRF token mismatch occurs, your server-side framework will likely throw an exception that results in an error response. For example, when using Laravel, a `TokenMismatchException` is thrown which results in a `419` error page. Since that isn't a valid Inertia response, the error is shown in a modal.
6464

65-
<video controls=""><source src="/mp4/csrf-mismatch-modal.mp4" type="video/mp4"></source></video>Obviously, this isn't a great user experience. A better way to handle these errors is to return a redirect back to the previous page, along with a flash message that the page expired. This will result in a valid Inertia response with the flash message available as a prop which you can then display to the user. Of course, you'll need to share your [flash messages](/v2/data-props/shared-data#flash-messages) with Inertia for this to work.
65+
<video controls className="w-full rounded-xl" src="/mp4/csrf-mismatch-modal.mp4"></video>
66+
67+
Obviously, this isn't a great user experience. A better way to handle these errors is to return a redirect back to the previous page, along with a flash message that the page expired. This will result in a valid Inertia response with the flash message available as a prop which you can then display to the user. Of course, you'll need to share your [flash messages](/shared-data#flash-messages) with Inertia for this to work.
6668

6769
When using Laravel, you may modify your application's exception handler to automatically redirect the user back to the page they were previously on while flashing a message to the session. To accomplish this, you may use the `respond` exception method in your application's `bootstrap/app.php` file.
6870

@@ -84,4 +86,4 @@ use Symfony\Component\HttpFoundation\Response;
8486

8587
The end result is a much better experience for your users. Instead of seeing the error modal, the user is instead presented with a message that the page "expired" and are asked to try again.
8688

87-
<video controls=""><source src="/mp4/csrf-mismatch-warning.mp4" type="video/mp4"></source></video>
89+
<video controls className="w-full rounded-xl" src="/mp4/csrf-mismatch-warning.mp4"></video>

0 commit comments

Comments
 (0)