Skip to content

Commit a175e86

Browse files
committed
Add comment to clarify the check for nonce URL
1 parent b701e6c commit a175e86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

WooCommerce/Classes/Authentication/SiteCredentialLoginUseCase.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ private extension SiteCredentialLoginUseCase {
160160
throw SiteCredentialLoginError.invalidLoginResponse
161161
}
162162

163+
/// The login request comes with a redirect header to nonce retrieval URL.
164+
/// If we get a response from this URL, that means the redirect is successful.
165+
/// We need to check the result of this redirect first to determine if login is successful.
163166
let isNonceUrl = response.url?.absoluteString.hasSuffix(Constants.wporgNoncePath) == true
164167

165168
switch (isNonceUrl, response.statusCode) {

0 commit comments

Comments
 (0)