build: use custom url scheme independent from appId

This commit is contained in:
Jovan Krunić
2022-02-08 18:42:26 +01:00
parent 35c9991a61
commit ea935232ab
2 changed files with 4 additions and 2 deletions

View File

@@ -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}`;
}

View File

@@ -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,