Amplify-js: Customize Error Messages amplify-authenticator ionic angular v4

Created on 1 Aug 2019  路  3Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *

Authentication

* What AWS Services are you utilizing? *

cognito using amplify angular-ionic

* Provide additional details e.g. code snippets *

How i can use this :

https://aws-amplify.github.io/docs/js/authentication#customize-error-messages

_Customize Error Messages
During authentication flows, Amplify handles error messages returned from the server. Amplify provides a simple way of customizing those error messages with a messageMap callback.

The function takes the original message as arguments and then outputs the desired message. Check AmplifyMessageMap.js file to see how Amplify makes the map function.

const map = (message) => {
if (/incorrect.username.password/i.test(message)) {
return 'Incorrect username or password';
}

return message;

}

You may notice in AmplifyMessageMap.js it also handles internationalization. This topic is covered in our I18n Guide._

Example :

But that not is working on ionic-angular v4

I see on :

https://github.com/aws-amplify/amplify-js/tree/master/packages/aws-amplify-angular/src/components/authenticator

But not exists an input Decorator for : errorMessage={map}

Ionic pending-close-response-required question

Most helpful comment

Still the issue is there but i don't know why it is closed without solution.

All 3 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

Still the issue is there but i don't know why it is closed without solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leantide picture leantide  路  3Comments

cosmosof picture cosmosof  路  3Comments

guanzo picture guanzo  路  3Comments

benevolentprof picture benevolentprof  路  3Comments

karlmosenbacher picture karlmosenbacher  路  3Comments