It's impossible now. I recommend using erros (error.code) code, which is a unique error code, and with this you can create something to associate this error code with your own text / language. There is an accessible page in the Firebase documentation that contains a list of those error codes that may help you. Check out these links: https://firebase.google.com/docs/reference/js/firebase.auth.Auth https://firebase.google.com/docs/reference/js/firebase.auth.Error https: // firebase.google.com/docs/auth/admin/errors?hl=en
Edit : To solve this problem, I translated it myself (in PT-BR, my language) and implemented (in TypeScript) the following steps:
I created an interface for storing an indexed array of strings:
export interface MessagesIndex { [index: string]: string; }
Then, in some interface or error service, I declared this variable as the interface above:
params = { 'invalid-argument': 'Erro: Um argumento inválido foi fornecido.', 'invalid-disabled-field': 'Erro: O valor fornecido para a propriedade de usuário é inválido.', } as MessagesIndex;
After that, I created a function to print it using the given code (from Firebase), do not forget to break it, because the error.code attribute comes as "auth / error-id", and we need only "error-id" here, and if the code no error was found, you can return some "Unknown error" and print error.code if you want:
public printErrorByCode(code: string): string { code = code.split('/')[1]; if (this.params[code]) { return (this.params[code]); } else { return ('Ocorreu algum erro desconhecido! \n Codigo erro: ' + code); } }
This is not the best code, but I hope this helps!
source share