summaryrefslogtreecommitdiffstats
path: root/core/src/utils/xhr-request.js
Commit message (Collapse)AuthorAgeFilesLines
* fix: wipe local storages on log outbackport/50956/stable30Maksim Sukharev2025-02-251-0/+20
| | | | Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
* fix: Redirect user to login if session is terminatedFerdinand Thiessen2025-01-091-6/+53
| | | | | | | | | | | | | | If a session timed out or was closed in another tab, then currently the user gets random error messages. This intercepts 401 responses (should only happen if logged out, or the users does something wrong). If we get a 401, we make sure its because of the session, by checking if the user can access the files app. If that is also the case we forward the user to the login page and set the redirect URL to the last used URL. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: Enable ESLint for apps and fix all errorsFerdinand Thiessen2024-07-091-1/+1
| | | | | | | | | Nevertheless this causes a huge amount of new warnings. Previously the shell script for directories to lint was wrong it was generating all app names to lint, but was missing the `apps/` prefix. Causing only `core` to be linted. Co-authored-by: Grigorii K. Shartsev <me@shgk.me> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-19/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix adding x-requested-with header for relative URLs when the base NC URL is ↵Julien Veyssier2023-11-241-2/+13
| | | | | | empty Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
* fix(xhr-request): Make sure to also allow strings as urlFerdinand Thiessen2023-10-171-12/+17
| | | | | | | | | | Our utility to add `X-Requested-With` headers on API calls intercepts calls to `window.fetch`, so we must ensure we allow all parameters that the default browser provided `window.fetch` allows. In this case make sure to allow all stringify-able objects. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
* only add x-requested-with header if requests point to NCJulien Veyssier2023-10-161-1/+12
| | | | Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
* fix: Set X-Requested-With header on all requests to avoid browser auth dialogsJulius Härtl2023-08-181-0/+55
Signed-off-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>