From 1da06b2d5e9f175d4fce077858dbd7e0b3c7990b Mon Sep 17 00:00:00 2001 From: flgubler-ergon <82028220+flgubler-ergon@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:24:39 +0100 Subject: [PATCH 1/2] Fix Browser-error in web-app In the web-app, we don't open another browser-window which needs to be closed at the end. This results in an error in the browser-log: "No active window to close" if the CapacitorBrowser is used => need the DefaultBrowser for it. --- demos/angular-capacitor/src/app/core/core.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/angular-capacitor/src/app/core/core.module.ts b/demos/angular-capacitor/src/app/core/core.module.ts index 7b2734e..acc974e 100644 --- a/demos/angular-capacitor/src/app/core/core.module.ts +++ b/demos/angular-capacitor/src/app/core/core.module.ts @@ -24,7 +24,8 @@ import { HttpClient } from '@angular/common/http'; }, { provide: Browser, - useClass: CapacitorBrowser + useFactory: (platform: Platform): Browser => platform.is("hybrid") ? new CapacitorBrowser() : new DefaultBrowser(), + deps: [Platform] }, { provide: AuthService, From f01cb4dd04a71210b8087572b9d6eef6dbf3ca43 Mon Sep 17 00:00:00 2001 From: Florian Gubler Date: Wed, 29 Jan 2025 08:22:27 +0100 Subject: [PATCH 2/2] Added necessary import --- demos/angular-capacitor/src/app/core/core.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/angular-capacitor/src/app/core/core.module.ts b/demos/angular-capacitor/src/app/core/core.module.ts index acc974e..3261e1c 100644 --- a/demos/angular-capacitor/src/app/core/core.module.ts +++ b/demos/angular-capacitor/src/app/core/core.module.ts @@ -3,7 +3,7 @@ import { Requestor, StorageBackend } from '@openid/appauth'; import { NgModule, NgZone } from '@angular/core'; import { CommonModule } from '@angular/common'; import { AuthService, Browser } from 'ionic-appauth'; -import { CapacitorBrowser, CapacitorSecureStorage } from 'ionic-appauth/lib/capacitor'; +import { CapacitorBrowser, DefaultBrowser, CapacitorSecureStorage } from 'ionic-appauth/lib/capacitor'; import { authFactory } from './factories'; import { httpFactory } from './factories/http.factory'; import { HttpClient } from '@angular/common/http';