|JSONResponse, array{}> * * 200: Device should be wiped * 404: Device should not be wiped */ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/check')] public function checkWipe(?string $token = ''): JSONResponse { if (!empty($token)) { try { if ($this->remoteWipe->start($token)) { return new JSONResponse([ 'wipe' => true ]); } } catch (InvalidTokenException $e) { // do nothing special, handled below } } return new JSONResponse([], Http::STATUS_NOT_FOUND); } /** * @NoAdminRequired * @NoCSRFRequired * @PublicPage * * @AnonRateThrottle(limit=10, period=300) * * Finish the wipe * * @param string $token App password * * @return JSONResponse, array{}> * * 200: Wipe finished successfully * 404: Device should not be wiped */ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/success')] public function wipeDone(?string $token = ''): JSONResponse { if (!empty($token)) { try { if ($this->remoteWipe->finish($token)) { return new JSONResponse([]); } } catch (InvalidTokenException $e) { // do nothing special, handled below } } return new JSONResponse([], Http::STATUS_NOT_FOUND); } }