mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
refactor: use current location for auth unless production
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/app",
|
"name": "@openstapps/app",
|
||||||
"version": "0.0.1",
|
"version": "2.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -116,8 +116,21 @@ function getEndpointsConfig(
|
|||||||
* Return a URL of the app, depending on the platform where it is running
|
* Return a URL of the app, depending on the platform where it is running
|
||||||
*/
|
*/
|
||||||
function getRedirectUrl(routePath: string): string {
|
function getRedirectUrl(routePath: string): string {
|
||||||
const appSchema = Capacitor.isNativePlatform()
|
let appHost: string;
|
||||||
? environment.custom_url_scheme
|
let appSchema: string;
|
||||||
: 'https';
|
if (environment.production) {
|
||||||
return `${appSchema}://${environment.app_host}/${routePath}`;
|
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