Skip to content

Commit 94242c6

Browse files
committed
Add wporgCredentials to AuthenticatedWebViewModel
1 parent 10a431f commit 94242c6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

WooCommerce/Classes/Authentication/AuthenticatedWebViewModel.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import WebKit
3+
import WordPressAuthenticator
34

45
/// Abstracts different configurations and logic for web view controllers
56
/// which are authenticated for WordPress.com, where possible
@@ -10,6 +11,10 @@ protocol AuthenticatedWebViewModel {
1011
/// Initial URL to be loaded on the web view
1112
var initialURL: URL? { get }
1213

14+
/// Optional credentials for authenticating with WP.org
15+
///
16+
var wporgCredentials: WordPressOrgCredentials? { get }
17+
1318
/// Triggered when the web view is dismissed
1419
func handleDismissal()
1520

@@ -19,3 +24,8 @@ protocol AuthenticatedWebViewModel {
1924
/// Handler for a navigation URL
2025
func decidePolicy(for navigationURL: URL) async -> WKNavigationActionPolicy
2126
}
27+
28+
/// Default implementation
29+
extension AuthenticatedWebViewModel {
30+
var wporgCredentials: WordPressOrgCredentials? { nil }
31+
}

0 commit comments

Comments
 (0)