File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
WooCommerce/Classes/Authentication Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11import Foundation
22import 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+ }
You can’t perform that action at this time.
0 commit comments