mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: use current location for auth unless production
This commit is contained in:
@@ -116,8 +116,21 @@ 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()
|
||||
? environment.custom_url_scheme
|
||||
: 'https';
|
||||
return `${appSchema}://${environment.app_host}/${routePath}`;
|
||||
let appHost: string;
|
||||
let appSchema: string;
|
||||
if (environment.production) {
|
||||
appSchema = Capacitor.isNativePlatform()
|
||||
? environment.custom_url_scheme
|
||||
: 'https';
|
||||
appHost = environment.app_host;
|
||||
} else {
|
||||
appSchema = Capacitor.isNativePlatform()
|
||||
? environment.custom_url_scheme
|
||||
: window.location.protocol.split(':')[0];
|
||||
|
||||
appHost = Capacitor.isNativePlatform()
|
||||
? environment.app_host
|
||||
: window.location.host;
|
||||
}
|
||||
return `${appSchema}://${appHost}/${routePath}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user