MOBILE-4604 iab: Clear session when open IAB with auto-login in Android
parent
ac920dc299
commit
0b9cab2aeb
|
@ -122,5 +122,6 @@
|
||||||
"font-awesome": ["fam"],
|
"font-awesome": ["fam"],
|
||||||
"moodle": ["moodle"]
|
"moodle": ["moodle"]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"clearIABSessionWhenAutoLogin": "android"
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ import { CoreFilepool } from '@services/filepool';
|
||||||
import { CoreSiteInfo } from './unauthenticated-site';
|
import { CoreSiteInfo } from './unauthenticated-site';
|
||||||
import { CoreAuthenticatedSite, CoreAuthenticatedSiteOptionalData, CoreSiteWSPreSets, WSObservable } from './authenticated-site';
|
import { CoreAuthenticatedSite, CoreAuthenticatedSiteOptionalData, CoreSiteWSPreSets, WSObservable } from './authenticated-site';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
|
import { CorePlatform } from '@services/platform';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that represents a site (combination of site + user).
|
* Class that represents a site (combination of site + user).
|
||||||
|
@ -557,6 +558,17 @@ export class CoreSite extends CoreAuthenticatedSite {
|
||||||
|
|
||||||
// Open the URL.
|
// Open the URL.
|
||||||
if (inApp) {
|
if (inApp) {
|
||||||
|
if (
|
||||||
|
options.clearsessioncache === undefined && autoLoginUrl !== url &&
|
||||||
|
(
|
||||||
|
CoreConstants.CONFIG.clearIABSessionWhenAutoLogin === 'all' ||
|
||||||
|
(CoreConstants.CONFIG.clearIABSessionWhenAutoLogin === 'android' && CorePlatform.isAndroid()) ||
|
||||||
|
(CoreConstants.CONFIG.clearIABSessionWhenAutoLogin === 'ios' && CorePlatform.isIOS())
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
options.clearsessioncache = 'yes';
|
||||||
|
}
|
||||||
|
|
||||||
return CoreUtils.openInApp(autoLoginUrl, options);
|
return CoreUtils.openInApp(autoLoginUrl, options);
|
||||||
} else {
|
} else {
|
||||||
return CoreUtils.openInBrowser(autoLoginUrl, options);
|
return CoreUtils.openInBrowser(autoLoginUrl, options);
|
||||||
|
|
|
@ -76,4 +76,5 @@ export interface EnvironmentConfig {
|
||||||
demoMode?: boolean; // Whether to run the app in "demo mode".
|
demoMode?: boolean; // Whether to run the app in "demo mode".
|
||||||
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
||||||
iconsPrefixes?: Record<string, Record<string, string[]>>; // Prefixes for custom font icons (located in src/assets/fonts).
|
iconsPrefixes?: Record<string, Record<string, string[]>>; // Prefixes for custom font icons (located in src/assets/fonts).
|
||||||
|
clearIABSessionWhenAutoLogin?: 'android' | 'ios' | 'all'; // Clear the session every time a new IAB is opened with auto-login.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue