Heuristic for stable9
Nextcloud 10 will have a way better logic...
This commit is contained in:
parent
107be703bf
commit
487bf76165
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue