aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/WipeController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller/WipeController.php')
-rw-r--r--core/Controller/WipeController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Controller/WipeController.php b/core/Controller/WipeController.php
index 6d3ff2aac1f..303d9e682d2 100644
--- a/core/Controller/WipeController.php
+++ b/core/Controller/WipeController.php
@@ -42,8 +42,8 @@ class WipeController extends Controller {
* 404: Device should not be wiped
*/
#[FrontpageRoute(verb: 'POST', url: '/core/wipe/check')]
- public function checkWipe(string $token = ''): JSONResponse {
- if ($token !== '') {
+ public function checkWipe(?string $token = ''): JSONResponse {
+ if (!empty($token)) {
try {
if ($this->remoteWipe->start($token)) {
return new JSONResponse([
@@ -76,8 +76,8 @@ class WipeController extends Controller {
* 404: Device should not be wiped
*/
#[FrontpageRoute(verb: 'POST', url: '/core/wipe/success')]
- public function wipeDone(string $token = ''): JSONResponse {
- if ($token !== '') {
+ public function wipeDone(?string $token = ''): JSONResponse {
+ if (!empty($token)) {
try {
if ($this->remoteWipe->finish($token)) {
return new JSONResponse([]);