1212 * @since 0.0.1
1313 */
1414
15- using System ;
16- using System . Diagnostics ;
17- using System . Net . Http ;
18- using System . Text . RegularExpressions ;
19- using System . Threading . Tasks ;
2015using Microsoft . UI . Xaml . Controls ;
2116using Microsoft . Web . WebView2 . Core ;
2217using passbolt . Exceptions ;
3126using passbolt . Services . NavigationService ;
3227using passbolt . Services . WebviewService ;
3328using passbolt . Utils ;
29+ using System ;
30+ using System . Diagnostics ;
31+ using System . Net . Http ;
32+ using System . Text . RegularExpressions ;
33+ using System . Threading . Tasks ;
3434
3535namespace passbolt . Controllers
3636{
@@ -103,7 +103,7 @@ public async Task BackgroundNavigationStarting(WebView2 sender, CoreWebView2Navi
103103 this . SetWebviewSettings ( webviewBackground ) ;
104104 }
105105 //When credentials are saved from import and we navigate to auth application we init the trusted domain to check API calls
106- if ( currentAccountMetaData == null && this . backgroundNavigationService . IsAuthApplication ( args . Uri ) )
106+ if ( currentAccountMetaData == null && this . backgroundNavigationService . IsAuthApplication ( args . Uri ) )
107107 {
108108 currentAccountMetaData = await this . credentialLockerService . GetAccountMetadata ( ) ;
109109 this . httpService . setTrustedDomain ( currentAccountMetaData . domain ) ;
@@ -211,7 +211,7 @@ public virtual void SetWebviewSettings(WebView2 webView)
211211 /// </summary>
212212 public virtual void NewWindowRequested ( CoreWebView2 sender , CoreWebView2NewWindowRequestedEventArgs args )
213213 {
214- if ( sender . Source == webviewRendered . Source . AbsoluteUri )
214+ if ( sender . Source == webviewRendered . Source . AbsoluteUri )
215215 {
216216 this . renderedNavigationService . CanOpenBrowser ( args . Uri ) ;
217217 }
@@ -230,7 +230,7 @@ public virtual void AllowNavigation(WebView2 sender, CoreWebView2NavigationStart
230230 {
231231 //When session is expired we are redirected to the API
232232 //To avoid this we catch the navigation and replicate the behaviour done during logout
233- if ( args . Uri . EndsWith ( "/auth/login" ) )
233+ if ( args . Uri . EndsWith ( "/auth/login" ) )
234234 {
235235 backgroundTopic . ProceedMessage ( new IPC ( AuthenticationTopics . LOG_OUT ) ) ;
236236 }
@@ -296,7 +296,7 @@ protected void WebMessageReceived(object sender, CoreWebView2WebMessageReceivedE
296296 IPC ipc = SerializationHelper . DeserializeFromJson < IPC > ( message ) ;
297297
298298 //Validate requestId to be an uuid
299- if ( ipc . requestId != null && ! this . validateUUIDRegex . IsMatch ( ipc . requestId ) )
299+ if ( ipc . requestId != null && ! this . validateUUIDRegex . IsMatch ( ipc . requestId ) )
300300 {
301301 throw new UnauthorizedTopicException ( ipc . topic ) ;
302302 }
@@ -345,7 +345,7 @@ public async Task BackgroundNavigationCompleted(WebView2 sender, CoreWebView2Nav
345345 this . backgroundTopic = new BackgroundTopic ( webviewBackground , webviewRendered , localFolderService , backgroundWebviewService ) ;
346346 }
347347 //Webview can be not initialized at this step so we wait it
348- if ( backgroundNavigationService != null )
348+ if ( backgroundNavigationService != null )
349349 {
350350 backgroundNavigationService . SetPreviousNavigation ( sender . CoreWebView2 . Source ) ;
351351 }
0 commit comments