Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/langindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,7 @@
"core.imageviewer": "local_moodlemobileapp",
"core.info": "moodle",
"core.invalidformdata": "error",
"core.invalidusername": "error",
"core.ioscookieshelp": "local_moodlemobileapp",
"core.labelsep": "langconfig",
"core.lastaccess": "moodle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { CoreLoadings } from '@services/overlays/loadings';
import { CoreAlerts } from '@services/overlays/alerts';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreLoginExceededAttemptsComponent } from '../../components/exceeded-attempts/exceeded-attempts';
import { CoreError } from '@classes/errors/error';

/**
* Page to recover a forgotten password.
Expand Down Expand Up @@ -125,7 +126,13 @@ export default class CoreLoginForgottenPasswordPage implements OnInit {
await CoreLoginHelper.passwordResetRequested(this.site.getURL());
}
} catch (error) {
CoreAlerts.showError(error);
if (error.errorcode === 'invalidparameter') {
CoreAlerts.showError(new CoreError(
Translate.instant(isMail ? 'core.login.invalidemail' : 'core.invalidusername'),
));
} else {
CoreAlerts.showError(error);
}
} finally {
modal.dismiss();
}
Expand Down
10 changes: 10 additions & 0 deletions src/core/features/login/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,13 @@ Feature: Test basic usage of login in app
When I go back in the app
And I press "Contact support" in the app
Then the app should have opened a browser tab with url ".*\/user\/contactsitesupport\.php"

Scenario: Reset password invalid parameters
When I launch the app
And I set the field "Your site" to "$WWWROOT" in the app
And I press "Connect to your site" in the app
And I press "Lost password?" in the app
Then I set the following fields to these values in the app:
| Enter either username or email address | test#test |
And I press "Search" in the app
And I should find "The given username contains invalid characters" in the app
1 change: 1 addition & 0 deletions src/core/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"imageviewer": "Image viewer",
"info": "Information",
"invalidformdata": "Incorrect form data",
"invalidusername": "The given username contains invalid characters",
"ioscookieshelp": "Embedded content might require cookies to work. Please go to the app's iOS settings, enable 'Allow Cross-Website Tracking' and try again.",
"labelsep": ":",
"lastaccess": "Last access",
Expand Down