|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 { try { if ($this->remoteWipe->start($token)) { return new JSONResponse([ 'wipe' => true ]); } return new JSONResponse([], Http::STATUS_NOT_FOUND); } catch (InvalidTokenException $e) { 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 { try { if ($this->remoteWipe->finish($token)) { return new JSONResponse([]); } return new JSONResponse([], Http::STATUS_NOT_FOUND); } catch (InvalidTokenException $e) { return new JSONResponse([], Http::STATUS_NOT_FOUND); } } }