aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller/LoginControllerTest.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: run rector on testsRobin Appelman2025-06-121-4/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* test: Finish migrating tests/Core/ to PHPUnit 10 compatible codetest/noid/more-phpunit-10Joas Schilling2025-05-021-29/+71
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat(login): add origin check at loginBenjamin Gaussorgues2024-12-051-5/+23
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-151-12/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat: don't count failed CSRF as failed login attemptBenjamin Gaussorgues2024-07-111-1/+0
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-17/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* feat(login): Clear login form (password) after IDLE timeoutFerdinand Thiessen2024-03-251-19/+9
| | | | | | | | | For security reasons it is recommended to stop the login process at a defined time, this could prevent password leaks by e.g. user forgetting that they entered their password on public devices. Enforced e.g. by the BSI ORP.4.A13 rule. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: update logincontroller testsEduardo Morales2024-03-101-5/+12
| | | | Signed-off-by: Eduardo Morales <emoral435@gmail.com>
* fix(tests): Fix remaining testsJoas Schilling2024-01-091-1/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix tests after slow logout fixLouis Chemineau2024-01-081-1/+4
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Cancel PR #37405, remove regression codeGaspard d'Hautefeuille2024-01-051-4/+25
| | | | Signed-off-by: Gaspard d'Hautefeuille <github@dhautefeuille.eu>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* techdebt(DI): Use public IThrottler interface which exists since Nextcloud 25Joas Schilling2023-08-281-3/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix testsGit'Fellow2023-03-281-25/+4
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Fix tests failures (number of calls differed with last rebase)Côme Chilliet2023-01-241-15/+15
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix a bunch of deprecation in the phpunit for coreCarl Schwan2023-01-241-30/+28
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(app framework)!: Inject services into controller methodsChristoph Wurst2023-01-181-20/+17
| | | | | | | | | | | | | | | Usually Nextcloud DI goes through constructor injection. This has the implication that each instance of a class builds the full DI tree. That is the injected services, their services, etc. Occasionally there is a service that is only needed for one controller method. Then the DI tree is build regardless if used or not. If services are injected into the method, we only build the DI tree if that method gets executed. This is also how Laravel allows injection. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix login loop if login CSRF fails and user is not logged inChristoph Wurst2023-01-181-10/+11
| | | | | | | | | | If CSRF fails but the user is logged in that they probably logged in in another tab. This is fine. We can just redirect. If CSRF fails and the user is also not logged in then something is fishy. E.g. because Nextcloud contantly regenrates the session and the CSRF token and the user is stuck in an endless login loop. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* chore: Make the LoginController strictChristoph Wurst2022-12-151-4/+17
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix unit testsJoas Schilling2022-08-311-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix Controller testsArthur Schiwon2022-07-221-6/+10
| | | | | | | | - added pageTitle in code was missing in expectations - fixed warnings of superflouos parameter - fixed wrong type of mock Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Update core to PHP 7.4 standardCarl Schwan2022-05-201-6/+0
| | | | | | | - Typed properties - Port to LoggerInterface Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* add check isFairUseOfFreePushService on loginVitor Mattos2021-10-231-7/+25
| | | | Signed-off-by: Vitor Mattos <vitor@php.rio>
* Deprecate RedirectToDefaultAppResponseDaniel Rudolf2021-07-011-7/+16
| | | | Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
* Add IUrlGenerator::linkToDefaultPageUrl()Daniel Rudolf2021-06-301-9/+8
| | | | | | Replaces the deprecated \OC_Util::getDefaultPageUrl() and makes this API public. Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
* Fix more controller tests in Core subdirVincent Petry2021-03-241-0/+2
| | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix absolute redirectJohn Molakvoæ (skjnldsv)2020-04-101-4/+4
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Start with webauthnRoeland Jago Douma2020-03-311-1/+7
| | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-12/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Send Clear-Site-Data expect for ChromeDaniel Kesselberg2019-11-301-0/+28
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't send executionContexts for Clear-Site-DataDaniel Kesselberg2019-07-091-2/+2
| | | | | | | | | | There are plans to remove executionContexts from the spec: https://github.com/w3c/webappsec-clear-site-data/issues/59 Firefox already removed it https://bugzilla.mozilla.org/show_bug.cgi?id=1548034 Chromium implementation is not finish: https://bugs.chromium.org/p/chromium/issues/detail?id=898503&q=clear-site-data&sort=-modified&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Vueify the login pageChristoph Wurst2019-05-291-39/+69
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add a login chain to reduce the complexity of LoginController::tryLoginChristoph Wurst2019-05-071-327/+110
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Honor remember_login_cookie_lifetimeRoeland Jago Douma2019-01-231-0/+24
| | | | | | | | | | | | If the remember_login_cookie_lifetime is set to 0 this means we do not want to use remember me at all. In that case we should also not creatae a remember me cookie and should create a proper temp token. Further this specifies that is not 0 the remember me time should always be larger than the session timeout. Because else the behavior is not really defined. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* adapted automated test for autocomplete changesRayn0r2018-10-301-6/+14
| | | | Signed-off-by: Rayn0r <Andre.Weidemann@web.de>
* Remove cookies from Clear-Site-Data HeaderPatrick Conrad2018-10-151-2/+2
| | | | | | | | | | | | | In https://github.com/nextcloud/server/commit/2f87fb6b456fd109c90a5093c31b7a3f62a32040 this header was introduced. The referenced documentation says: > When delivered with a response from https://example.com/clear, the following header will cause cookies associated with the origin https://example.com to be cleared, as well as cookies on any origin in the same registered domain (e.g. https://www.example.com/ and https://more.subdomains.example.com/). This also applies if `https://nextcloud.example.com/` sends the `Clear-Site-Data: "cookies"` header. This is not the behavior we want at this point! So I removed the deletion of cookies from the header. This has no effect on the logout process as this header is supported only recently and the logout works in old browsers as well. Signed-off-by: Patrick Conrad <conrad@iza.org>
* Fix login redirection if only one 2FA provider is activeChristoph Wurst2018-08-081-5/+6
| | | | | | Fixes https://github.com/nextcloud/server/issues/10500. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Adds disabled user unit testsMichael Weimann2018-07-211-3/+47
| | | | Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
* Make 2FA providers statefulChristoph Wurst2018-06-201-15/+17
| | | | | | | | | | | This adds persistence to the Nextcloud server 2FA logic so that the server knows which 2FA providers are enabled for a specific user at any time, even when the provider is not available. The `IStatefulProvider` interface was added as tagging interface for providers that are compatible with this new API. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix testsRoeland Jago Douma2018-04-061-17/+5
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-01-151-1/+18
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Hide stay logged in checkbox when flow authentication is usedJulius Härtl2017-12-281-0/+33
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix broken testsMorris Jobke2017-09-041-1/+6
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix LoginControllerRoeland Jago Douma2017-08-091-0/+4
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add metadata to \OCP\AppFramework\Http\Response::throttleLukas Reschke2017-07-271-2/+2
| | | | | | Fixes https://github.com/nextcloud/server/issues/5891 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>