Skip to content

Commit 1a012ac

Browse files
committed
Add link to WordPressKit library for reference of the WPOrg authentication
1 parent 1d1cea9 commit 1a012ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

WooCommerce/Classes/Extensions/WKWebView+Authenticated.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import class Networking.UserAgent
1010
extension WKWebView {
1111
static let wporgNoncePath = "/admin-ajax.php?action=rest-nonce"
1212

13+
/// Cookie authentication following WordPressKit implementation:
14+
/// https://github.com/wordpress-mobile/WordPressKit-iOS/blob/trunk/WordPressKit/Authenticator.swift
15+
///
1316
func authenticateForWPOrg(with credentials: WordPressOrgCredentials) throws -> URLRequest {
1417
var request = try URLRequest(url: credentials.loginURL.asURL(), method: .post)
1518
request.httpShouldHandleCookies = true

0 commit comments

Comments
 (0)