Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--appinfo/app.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index a940ca0f..05ba9f80 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -50,8 +50,10 @@ try {
}
// Redirect all requests to the login page to the SAML login
+// Since with Nextcloud 9 we don't have an unique entry point this is a little
+// bit hacky and won't necessarily detect all situations.
$currentUrl = substr(explode('?',$request->getRequestUri(), 2)[0], strlen(\OC::$WEBROOT));
-if($currentUrl === '/index.php/login' && !OC_User::isLoggedIn()) {
+if(($currentUrl === '/' || $currentUrl === '/index.php/' || $currentUrl === '/index.php') && !OC_User::isLoggedIn()) {
$csrfToken = \OC::$server->getCsrfTokenManager()->getToken();
header('Location: '.$urlGenerator->linkToRouteAbsolute('user_saml.SAML.login') .'?requesttoken='. urlencode($csrfToken->getEncryptedValue()));
exit();