forked from EVOgeek/Vmeda.Online
MOBILE-4201 login: Remove SSO open browser confirmation
parent
eead77bff9
commit
ed900d9d1a
|
@ -90,7 +90,6 @@
|
|||
"multisitesdisplay": "",
|
||||
"sitefindersettings": {},
|
||||
"onlyallowlistedsites": false,
|
||||
"skipssoconfirmation": false,
|
||||
"forcedefaultlanguage": false,
|
||||
"privacypolicy": "https://moodle.net/moodle-app-privacy/",
|
||||
"notificoncolor": "#f98012",
|
||||
|
|
|
@ -2087,7 +2087,6 @@
|
|||
"core.login.invalidvaluemin": "local_moodlemobileapp",
|
||||
"core.login.login": "moodle",
|
||||
"core.login.loginbutton": "local_moodlemobileapp",
|
||||
"core.login.logininsiterequired": "local_moodlemobileapp",
|
||||
"core.login.loginsteps": "moodle",
|
||||
"core.login.missingemail": "moodle",
|
||||
"core.login.missingfirstname": "moodle",
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
"invalidvaluemin": "The minimum value is {{$a}}",
|
||||
"login": "Log in",
|
||||
"loginbutton": "Log in",
|
||||
"logininsiterequired": "You need to log in to the site in a browser window.",
|
||||
"loginsteps": "For full access to this site, you first need to create an account.",
|
||||
"missingemail": "Missing email address",
|
||||
"missingfirstname": "Missing given name",
|
||||
|
|
|
@ -217,7 +217,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
|
||||
CoreLoginHelper.confirmAndOpenBrowserForSSOLogin(
|
||||
CoreLoginHelper.openBrowserForSSOLogin(
|
||||
this.siteCheck.siteUrl,
|
||||
this.siteCheck.code,
|
||||
this.siteCheck.service,
|
||||
|
|
|
@ -301,7 +301,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
|
||||
CoreLoginHelper.confirmAndOpenBrowserForSSOLogin(
|
||||
CoreLoginHelper.openBrowserForSSOLogin(
|
||||
this.siteUrl,
|
||||
this.siteConfig.typeoflogin,
|
||||
undefined,
|
||||
|
|
|
@ -141,7 +141,7 @@ export class CoreLoginHelperProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Show a confirm modal if needed and open a browser to perform SSO login.
|
||||
* Open a browser to perform SSO login.
|
||||
*
|
||||
* @param siteUrl URL of the site where the SSO login will be performed.
|
||||
* @param typeOfLogin CoreConstants.LOGIN_SSO_CODE or CoreConstants.LOGIN_SSO_INAPP_CODE.
|
||||
|
@ -149,6 +149,7 @@ export class CoreLoginHelperProvider {
|
|||
* @param launchUrl The URL to open for SSO. If not defined, default tool mobile launch URL will be used.
|
||||
* @param redirectData Data of the path/url to open once authenticated. If not defined, site initial page.
|
||||
* @returns Promise resolved when done or if user cancelled.
|
||||
* @deprecated since 4.3. Use openBrowserForSSOLogin instead.
|
||||
*/
|
||||
async confirmAndOpenBrowserForSSOLogin(
|
||||
siteUrl: string,
|
||||
|
@ -157,18 +158,6 @@ export class CoreLoginHelperProvider {
|
|||
launchUrl?: string,
|
||||
redirectData?: CoreRedirectPayload,
|
||||
): Promise<void> {
|
||||
// Show confirm only if it's needed. Treat "false" (string) as false to prevent typing errors.
|
||||
const showConfirmation = this.shouldShowSSOConfirm(typeOfLogin);
|
||||
|
||||
if (showConfirmation) {
|
||||
try {
|
||||
await CoreDomUtils.showConfirm(Translate.instant('core.login.logininsiterequired'));
|
||||
} catch {
|
||||
// User canceled, stop.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.openBrowserForSSOLogin(siteUrl, typeOfLogin, service, launchUrl, redirectData);
|
||||
}
|
||||
|
||||
|
@ -978,10 +967,11 @@ export class CoreLoginHelperProvider {
|
|||
*
|
||||
* @param typeOfLogin CoreConstants.LOGIN_SSO_CODE or CoreConstants.LOGIN_SSO_INAPP_CODE.
|
||||
* @returns True if confirm modal should be shown, false otherwise.
|
||||
* @deprecated since 4.3 Not used anymore.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
shouldShowSSOConfirm(typeOfLogin: number): boolean {
|
||||
return !this.isSSOEmbeddedBrowser(typeOfLogin) &&
|
||||
(!CoreConstants.CONFIG.skipssoconfirmation || String(CoreConstants.CONFIG.skipssoconfirmation) === 'false');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -390,7 +390,6 @@ export class CoreCustomURLSchemesProvider {
|
|||
* @returns Promise resolved when done.
|
||||
*/
|
||||
protected async goToAddSite(data: CoreCustomURLSchemesParams, siteCheck: CoreSiteCheckResponse): Promise<void> {
|
||||
const ssoNeeded = CoreLoginHelper.isSSOLoginNeeded(siteCheck.code);
|
||||
const pageParams = {
|
||||
username: data.username,
|
||||
urlToOpen: data.redirect,
|
||||
|
@ -401,7 +400,6 @@ export class CoreCustomURLSchemesProvider {
|
|||
// Ask the user before changing site.
|
||||
await CoreDomUtils.showConfirm(Translate.instant('core.contentlinks.confirmurlothersite'));
|
||||
|
||||
if (!ssoNeeded) {
|
||||
const willReload = await CoreSites.logoutForRedirect(CoreConstants.NO_SITE_ID, {
|
||||
redirectPath: '/login/credentials',
|
||||
redirectOptions: { params: pageParams },
|
||||
|
@ -411,19 +409,9 @@ export class CoreCustomURLSchemesProvider {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ssoNeeded) {
|
||||
CoreLoginHelper.confirmAndOpenBrowserForSSOLogin(
|
||||
siteCheck.siteUrl,
|
||||
siteCheck.code,
|
||||
siteCheck.service,
|
||||
siteCheck.config?.launchurl,
|
||||
);
|
||||
} else {
|
||||
await CoreNavigator.navigateToLoginCredentials(pageParams);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a URL is a custom URL scheme.
|
||||
|
|
|
@ -46,7 +46,6 @@ export interface EnvironmentConfig {
|
|||
multisitesdisplay: CoreLoginSiteSelectorListMethod;
|
||||
sitefindersettings: Partial<CoreLoginSiteFinderSettings>;
|
||||
onlyallowlistedsites: boolean;
|
||||
skipssoconfirmation: boolean;
|
||||
forcedefaultlanguage: boolean;
|
||||
privacypolicy: string;
|
||||
notificoncolor: string;
|
||||
|
|
Loading…
Reference in New Issue