Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit cfd8302

Browse files
committed
Add invalid credential pattern detection
1 parent a90104c commit cfd8302

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/NonceRestClient.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,11 @@ class NonceRestClient @Inject constructor(
145145
return HtmlUtils.fastStripHtml(errorHtml)
146146
.trim(' ', '\n')
147147
}
148+
149+
private fun hasInvalidCredentialsPattern(htmlResponse: String) =
150+
htmlResponse.contains(INVALID_CREDENTIAL_HTML_PATTERN)
151+
152+
companion object {
153+
const val INVALID_CREDENTIAL_HTML_PATTERN = "document.querySelector('form').classList.add('shake')"
154+
}
148155
}

0 commit comments

Comments
 (0)