mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-31 16:00:09 +00:00
Revert "feat: show deSEC password field only after email-already-registered failure, via POST /containers and Twig (no sessions, no query params)"
This reverts commit 44b257a2b5.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AIO\Desec;
|
||||
|
||||
/**
|
||||
* Thrown when the deSEC API reports that the supplied email address is already
|
||||
* associated with an existing account (HTTP 400 with an "email" error field).
|
||||
*/
|
||||
class AlreadyRegisteredException extends \Exception {
|
||||
public function __construct(string $email) {
|
||||
parent::__construct(
|
||||
'This email address is already registered at deSEC. '
|
||||
. 'If this is your account, please enter your deSEC password in the password field and try again.',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,10 @@ class DesecManager {
|
||||
if ($code === 400) {
|
||||
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
if (is_array($data) && isset($data['email'])) {
|
||||
throw new AlreadyRegisteredException($email);
|
||||
throw new \Exception(
|
||||
'This email address is already registered at deSEC. '
|
||||
. 'If this is your account, please enter your deSEC password in the password field and try again.',
|
||||
);
|
||||
}
|
||||
throw new \Exception('Registration at deSEC failed (HTTP 400): ' . $body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user