🔐 Removes auth from backend
This commit is contained in:
@@ -22,8 +22,7 @@ static char md5[33] = "\0";
|
||||
|
||||
static FileType fileType = ft_none;
|
||||
|
||||
UploadFirmwareService::UploadFirmwareService(PsychicHttpServer *server, SecurityManager *securityManager)
|
||||
: _server(server), _securityManager(securityManager) {}
|
||||
UploadFirmwareService::UploadFirmwareService(PsychicHttpServer *server) : _server(server) {}
|
||||
|
||||
void UploadFirmwareService::begin() {
|
||||
_server->maxUploadSize = 2300000; // 2.3 MB
|
||||
@@ -42,12 +41,6 @@ void UploadFirmwareService::begin() {
|
||||
|
||||
esp_err_t UploadFirmwareService::handleUpload(PsychicRequest *request, const String &filename, uint64_t index,
|
||||
uint8_t *data, size_t len, bool final) {
|
||||
// quit if not authorized
|
||||
Authentication authentication = _securityManager->authenticateRequest(request);
|
||||
if (!AuthenticationPredicates::IS_ADMIN(authentication)) {
|
||||
return handleError(request, 403); // forbidden
|
||||
}
|
||||
|
||||
// at init
|
||||
if (!index) {
|
||||
// check details of the file, to see if its a valid bin or json file
|
||||
|
||||
Reference in New Issue
Block a user