added password check for DELETE method #7

Merged
dafo5502 merged 2 commits from delete_auth into master 2021-10-28 09:32:24 +02:00
Showing only changes of commit df0294a35b - Show all commits

View File

@ -54,7 +54,7 @@ def create_app():
@app.route('/presentation/<string:presentation>', methods=['DELETE'])
def delete_presentation(presentation):
data = request.get_json()
if not data['auth'] or not _valid_credential(data['auth']):
if not 'auth' in data or not _valid_credential(data['auth']):
return Response(response="Use correct credentials to access this endpoint", status=401)
shutil.rmtree(os.path.join(storagedir, presentation))