Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix NC28]Fix for E-Mail Center: MagentaCLOUD not available #266

Open
wants to merge 1 commit into
base: stable28
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions lib/private/legacy/OC_User.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@
*/
use OC\Authentication\Token\IProvider;
use OC\User\LoginException;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\Authentication\Exceptions\WipeTokenException;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IGroupManager;
use OCP\ISession;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Server;
use OCP\Session\Exceptions\SessionNotAvailableException;
use OCP\User\Events\BeforeUserLoggedInEvent;
use OCP\User\Events\UserLoggedInEvent;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -200,12 +203,17 @@ public static function loginWithApache(\OCP\Authentication\IApacheBackend $backe

if (empty($password)) {
$tokenProvider = \OC::$server->get(IProvider::class);
$token = $tokenProvider->getToken($userSession->getSession()->getId());
$token->setScope([
'password-unconfirmable' => true,
'filesystem' => true,
]);
$tokenProvider->updateToken($token);
try {
$token = $tokenProvider->getToken($userSession->getSession()->getId());
$token->setScope([
'password-unconfirmable' => true,
'filesystem' => true,
]);
$tokenProvider->updateToken($token);
} catch (InvalidTokenException|WipeTokenException|SessionNotAvailableException) {
// swallow the exceptions as we do not deal with them here
// simply skip updating the token when is it missing
}
}

// setup the filesystem
Expand Down