From db13a26f741f35e4c8db2cb777160b2ba13b54c7 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Mon, 15 Jan 2024 13:11:01 +0100 Subject: [PATCH] MDL-76671 tool_mobile: Allow OAuth launches after accepting policies --- admin/tool/mobile/launch.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/tool/mobile/launch.php b/admin/tool/mobile/launch.php index c1fa2a6880f20..3acfe218d8431 100644 --- a/admin/tool/mobile/launch.php +++ b/admin/tool/mobile/launch.php @@ -56,8 +56,9 @@ // Check if the plugin is properly configured. $typeoflogin = get_config('tool_mobile', 'typeoflogin'); -if (empty($SESSION->justloggedin) and - $typeoflogin != tool_mobile\api::LOGIN_VIA_BROWSER and +if (empty($SESSION->justloggedin) && + !is_enabled_auth('oauth2') && + $typeoflogin != tool_mobile\api::LOGIN_VIA_BROWSER && $typeoflogin != tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER) { throw new moodle_exception('pluginnotenabledorconfigured', 'tool_mobile'); }