From ea935232abaf374f2936c496e77f0b23fd7fe236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Tue, 8 Feb 2022 18:42:26 +0100 Subject: [PATCH] build: use custom url scheme independent from appId --- src/app/modules/auth/factories/auth.factory.ts | 5 +++-- src/environments/environment.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/modules/auth/factories/auth.factory.ts b/src/app/modules/auth/factories/auth.factory.ts index 186bccbf..a74470cd 100644 --- a/src/app/modules/auth/factories/auth.factory.ts +++ b/src/app/modules/auth/factories/auth.factory.ts @@ -21,7 +21,6 @@ import { } from '@openid/appauth'; import {Browser, IAuthConfig} from 'ionic-appauth'; import {PAIAAuthService} from '../paia/paia-auth.service'; -import config from '../../../../../capacitor.config'; import {ConfigProvider} from '../../config/config.provider'; import { SCAuthorizationProvider, @@ -117,6 +116,8 @@ function getEndpointsConfig( * Return a URL of the app, depending on the platform where it is running */ function getRedirectUrl(routePath: string): string { - const appSchema = Capacitor.isNativePlatform() ? config.appId : 'https'; + const appSchema = Capacitor.isNativePlatform() + ? environment.custom_url_scheme + : 'https'; return `${appSchema}://${environment.app_host}/${routePath}`; } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 4053a926..4da36a93 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -21,6 +21,7 @@ export const environment = { backend_url: 'https://mobile.server.uni-frankfurt.de', daia_url: 'https://daia.hebis.de/DAIA2/UB_Frankfurt', app_host: 'mobile.app.uni-frankfurt.de', + custom_url_scheme: 'de.anyschool.app', backend_version: '2.0.0', use_fake_backend: false, production: false,