diff --git a/tests/index.php b/tests/index.php index d41f29f..4611c06 100644 --- a/tests/index.php +++ b/tests/index.php @@ -617,6 +617,22 @@ function processRequestData(\Delight\Auth\Auth $auth) { return 'too many requests'; } } + else if ($_POST['action'] === 'changeUsername') { + try { + $auth->changeUsername($_POST['newUsername'], $_POST['requireUnique']); + + return 'ok'; + } + catch (\Delight\Auth\DuplicateUsernameException $e) { + return 'username already exists'; + } + catch (\Delight\Auth\NotLoggedInException $e) { + return 'not logged in'; + } + catch (\Delight\Auth\TooManyRequestsException $e) { + return 'too many requests'; + } + } else if ($_POST['action'] === 'setPasswordResetEnabled') { try { $auth->setPasswordResetEnabled($_POST['enabled'] == 1); @@ -1075,6 +1091,16 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) { echo ''; echo ''; + echo '
'; + echo ''; + echo ' '; + echo ' '; + echo ''; + echo '
'; + \showConfirmEmailForm(); echo '
';