aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller/LostControllerTest.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: run rector on tests with new rulerector-testsRobin Appelman2025-06-121-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: run rector on testsRobin Appelman2025-06-121-2/+2
| | | | 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-11/+23
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-151-18/+18
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-24/+24
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-19/+2
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(tests): Adjust unit testsJoas Schilling2023-05-151-8/+8
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add some tests for input trimming in LostController.phpJoshua Trees2023-04-051-0/+36
| | | | Signed-off-by: Joshua Trees <me@jtrees.io>
* fix(CI): Adjust expected resultJoas Schilling2023-02-061-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix LostController testCôme Chilliet2022-10-181-2/+7
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Make LostController use IInitialState and LoggerInterfaceThomas Citharel2022-06-101-6/+18
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Modernize the LostControllerTest testThomas Citharel2022-06-101-33/+25
| | | | | | Remove some depreciated at() calls Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Add password reset typed eventsThomas Citharel2022-06-101-12/+32
| | | | | | These hooks are only used in the Encryption app from what I can see. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Update core to PHP 7.4 standardCarl Schwan2022-05-201-7/+7
| | | | | | | - Typed properties - Port to LoggerInterface Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* fixes missing prefix to validate password reset tokenArthur Schiwon2021-09-101-2/+5
| | | | | | - also fixes the test which missed asserting the presence of it Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* move verification token logic out of lost password controllerArthur Schiwon2021-09-091-258/+43
| | | | | | | - to make it reusable - needed for local email verification Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Send emails on password reset to the displaynameJoas Schilling2021-02-181-3/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-14/+13
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-2/+6
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-12/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-28/+28
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add test case for existing user with token nullDaniel Kesselberg2019-08-181-0/+16
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Return the disabled user mock instead of the existingDaniel Kesselberg2019-08-181-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge pull request #16544 from nextcloud/bugfix/16540Roeland Jago Douma2019-07-311-5/+15
|\ | | | | Add missing password reset page to vue
| * Move actual password reset to vueJulius Härtl2019-07-311-5/+15
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Use proper exception in lostControllerRoeland Jago Douma2019-07-271-3/+9
|/ | | | | | | | | | There is no need to log the expcetion of most of the stuff here. We should properly log them but an exception is excessive. This moves it to a proper exception which we can catch and then log. The other exceptions will still be fully logged. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Return first value from $usersDaniel Kesselberg2019-07-091-24/+27
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Clean pending 2FA authentication on password resetRoeland Jago Douma2019-01-291-1/+6
| | | | | | | | | | | When a password is reste we should make sure that all users are properly logged in. Pending states should be cleared. For example a session where the 2FA code is not entered yet should be cleared. The token is now removed so the session will be killed the next time this is checked (within 5 minutes). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2019-01-151-9/+23
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #10743 from ↵blizzz2018-09-131-0/+84
|\ | | | | | | | | danielkesselberg/bugfix/noid/allow-password-reset-for-duplicate-email Enable password reset for user with same email address when only one is active
| * Enable password reset for user with same email address when only one is activeDaniel Kesselberg2018-08-191-0/+84
| | | | | | | | | | | | | | | | | | When two or more user share the same email address its not possible to reset password by email. Even when only one account is active. This pr reduce list of users returned by getByEmail by disabled users. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Change password expiration time from 12h to 7dMorris Jobke2018-08-311-1/+1
|/ | | | | | We use the same logic for creating accounts without a password and there the 12h is a bit short. Users don't expect that the signup link needs to be clicked within 12h - 7d should be a more expected behavior. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* update unit testsBjoern Schiessle2018-08-151-1/+41
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* prefill userid for login after password resetRobin Appelman2018-06-211-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix testsRoeland Jago Douma2018-01-131-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use ::class in test mocksMorris Jobke2017-10-241-3/+3
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Set the data from the templateJoas Schilling2017-10-181-36/+21
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* No password reset for disabled usersJoas Schilling2017-08-181-0/+29
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix LostControllerTestRoeland Jago Douma2017-08-091-0/+4
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Disable the API endpoints as wellJoas Schilling2017-05-111-15/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Rename renderHTML to renderHtmlMorris Jobke2017-04-191-3/+3
| | | | | | | * fixes #4383 * improves consistency Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Adjust existing bruteforce protection codeLukas Reschke2017-04-141-15/+22
| | | | | | | - Moves code to annotation - Adds the `throttle()` call on the responses on existing annotations Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Update email template for lost password emailMorris Jobke2017-04-121-6/+52
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Move OC_Defaults to OCP\DefaultsMorris Jobke2017-04-091-3/+3
| | | | | | | | | | | | | * currently there are two ways to access default values: OCP\Defaults or OC_Defaults (which is extended by OCA\Theming\ThemingDefaults) * our code used a mixture of both of them, which made it hard to work on theme values * this extended the public interface with the missing methods and uses them everywhere to only rely on the public interface Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Allow to reset the password with the email as an inputJoas Schilling2017-03-281-10/+75
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* create new encryption keys on password reset and backup the old oneBjoern Schiessle2017-01-101-38/+0
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* fix password reset if encryption is enabledBjoern Schiessle2016-12-081-0/+39
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>