summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-02 21:45:10 +0200
committerGitHub <noreply@github.com>2018-10-02 21:45:10 +0200
commit6b730b4c478bc4f55a89fd7d6a7c2715e2e5b829 (patch)
tree06218c0625e5ddc4045a7990347bcb8ca7fdc5ce /core
parent19d552e00b16d8b5423b01755b5b1027df5a21ed (diff)
parent19f84f7b5485e204014671d0439e8af5693acbb1 (diff)
downloadnextcloud-server-6b730b4c478bc4f55a89fd7d6a7c2715e2e5b829.tar.gz
nextcloud-server-6b730b4c478bc4f55a89fd7d6a7c2715e2e5b829.zip
Merge pull request #11390 from nextcloud/feature/11043/apptoken_v3
Apptoken v3: imrpove token handling on external password change
Diffstat (limited to 'core')
-rw-r--r--core/Controller/LoginController.php1
-rw-r--r--core/Migrations/Version15000Date20180926101451.php53
2 files changed, 54 insertions, 0 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 09b6fe54384..14e3b4c40b3 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -320,6 +320,7 @@ class LoginController extends Controller {
// requires https://github.com/owncloud/core/pull/24616
$this->userSession->completeLogin($loginResult, ['loginName' => $user, 'password' => $password]);
$this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, IToken::REMEMBER);
+ $this->userSession->updateTokens($loginResult->getUID(), $password);
// User has successfully logged in, now remove the password reset link, when it is available
$this->config->deleteUserValue($loginResult->getUID(), 'core', 'lostpassword');
diff --git a/core/Migrations/Version15000Date20180926101451.php b/core/Migrations/Version15000Date20180926101451.php
new file mode 100644
index 00000000000..00a55455764
--- /dev/null
+++ b/core/Migrations/Version15000Date20180926101451.php
@@ -0,0 +1,53 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Core\Migrations;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\SimpleMigrationStep;
+use OCP\Migration\IOutput;
+
+class Version15000Date20180926101451 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $table = $schema->getTable('authtoken');
+ $table->addColumn('password_invalid','boolean', [
+ 'notnull' => true,
+ 'default' => false,
+ ]);
+
+ return $schema;
+ }
+
+}