This commit is contained in:
immerda 2021-06-02 20:54:55 +02:00 committed by GitHub
commit 18d6cabe91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -173,7 +173,9 @@ class OC_User {
$userSession = \OC::$server->getUserSession(); $userSession = \OC::$server->getUserSession();
$userSession->setLoginName($uid); $userSession->setLoginName($uid);
$request = OC::$server->getRequest(); $request = OC::$server->getRequest();
$userSession->createSessionToken($request, $uid, $uid); $secret = $backend->getCurrentUserSecret();
$userSession->createSessionToken($request, $uid, $uid, $secret);
$pw = $secret === null ? '' : $secret;
// setup the filesystem // setup the filesystem
OC_Util::setupFS($uid); OC_Util::setupFS($uid);
// first call the post_login hooks, the login-process needs to be // first call the post_login hooks, the login-process needs to be
@ -185,7 +187,7 @@ class OC_User {
'post_login', 'post_login',
[ [
'uid' => $uid, 'uid' => $uid,
'password' => '', 'password' => $pw,
'isTokenLogin' => false, 'isTokenLogin' => false,
] ]
); );

View File

@ -62,4 +62,12 @@ interface IApacheBackend {
* @since 6.0.0 * @since 6.0.0
*/ */
public function getCurrentUserId(); public function getCurrentUserId();
/**
* Optionally returns a stable per-user secret. This secret is for
* instance used to secure file encryption keys.
* @return string|null
* @since 21.0.0
*/
public function getCurrentUserSecret();
} }