Skip to content

Conversation

@ChristophWurst
Copy link
Contributor

@ChristophWurst ChristophWurst commented Sep 27, 2022

For nextcloud/mail#5714

This fetches a new CSRF token right when it doesn't validate anymore.

How to test

  1. Log into Nextcloud
  2. Open a second tab
  3. Log out on the second tab
  4. Log in again on the second tab
  5. Trigger an action with a HTTP request on the first tab

On master: request fails with 412, the error bubbles up and the action fails.
Here: request fails with 412, there is another request to fetch a CSRF token, the request is sent again and works. The action succeeds.

@ChristophWurst ChristophWurst added enhancement New feature or request 2. developing labels Sep 27, 2022
@ChristophWurst ChristophWurst self-assigned this Sep 27, 2022
@ChristophWurst
Copy link
Contributor Author

Bildschirmfoto vom 2022-09-27 18-15-51

Works ✨

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the enhancement/csrf-expiry-retry-handler branch from f0cff7e to 5fd1e77 Compare September 30, 2022 15:18
@ChristophWurst ChristophWurst marked this pull request as ready for review September 30, 2022 15:18
Copy link

@vinicius73 vinicius73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: After request the new CSRF, the other tab (in the test scenario) still working?

Copy link
Contributor

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works (in Mail).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants