[android][auth] Update code regex pattern to handle messages contained within the code brackets
This commit is contained in:
parent
87eb76520e
commit
840f6b0ced
|
@ -718,9 +718,9 @@ public class RNFirebaseAuth extends ReactContextBaseJavaModule {
|
|||
code = authException.getErrorCode();
|
||||
message = authException.getMessage();
|
||||
} catch (Exception e) {
|
||||
Matcher matcher = Pattern.compile("\\[(.*?)\\]").matcher(message);
|
||||
Matcher matcher = Pattern.compile("\\[(.*):.*\\]").matcher(message);
|
||||
if (matcher.find()) {
|
||||
code = matcher.group().substring(2, matcher.group().length() - 2).trim();
|
||||
code = matcher.group(1).trim();
|
||||
switch (code) {
|
||||
case "INVALID_CUSTOM_TOKEN":
|
||||
message = "The custom token format is incorrect. Please check the documentation.";
|
||||
|
|
Loading…
Reference in New Issue