[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();
|
code = authException.getErrorCode();
|
||||||
message = authException.getMessage();
|
message = authException.getMessage();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Matcher matcher = Pattern.compile("\\[(.*?)\\]").matcher(message);
|
Matcher matcher = Pattern.compile("\\[(.*):.*\\]").matcher(message);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
code = matcher.group().substring(2, matcher.group().length() - 2).trim();
|
code = matcher.group(1).trim();
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case "INVALID_CUSTOM_TOKEN":
|
case "INVALID_CUSTOM_TOKEN":
|
||||||
message = "The custom token format is incorrect. Please check the documentation.";
|
message = "The custom token format is incorrect. Please check the documentation.";
|
||||||
|
|
Loading…
Reference in New Issue