From 414676468679ba93befde00322fcf2b8af9f3d2d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 28 Aug 2021 00:07:23 +0200 Subject: Confirm mails only per POST - this is to avoid automatic confirmation by certain softwares that open links Signed-off-by: Arthur Schiwon --- lib/private/Security/VerificationToken/VerificationToken.php | 4 ++++ lib/public/Security/VerificationToken/IVerificationToken.php | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/private/Security/VerificationToken/VerificationToken.php b/lib/private/Security/VerificationToken/VerificationToken.php index ff3cb90727a..c85e0e7b5a1 100644 --- a/lib/private/Security/VerificationToken/VerificationToken.php +++ b/lib/private/Security/VerificationToken/VerificationToken.php @@ -122,4 +122,8 @@ class VerificationToken implements IVerificationToken { return $token; } + + public function delete(string $token, IUser $user, string $subject): void { + $this->config->deleteUserValue($user->getUID(), 'core', $subject); + } } diff --git a/lib/public/Security/VerificationToken/IVerificationToken.php b/lib/public/Security/VerificationToken/IVerificationToken.php index cbcae69f833..584928426de 100644 --- a/lib/public/Security/VerificationToken/IVerificationToken.php +++ b/lib/public/Security/VerificationToken/IVerificationToken.php @@ -52,4 +52,11 @@ interface IVerificationToken { * @since 22.2.0 */ public function create(IUser $user, string $subject, string $passwordPrefix = ''): string; + + /** + * Deletes the token identified by the provided parameters + * + * @since 22.2.0 + */ + public function delete(string $token, IUser $user, string $subject): void; } -- cgit v1.2.3