From 7cd51fe1eb9e5c39ba41062026cb0440a64181e0 Mon Sep 17 00:00:00 2001 From: Arksine Date: Mon, 9 Nov 2020 07:00:53 -0500 Subject: [PATCH] authorization: update request handlers to accept WebRequest objects Signed-off-by: Eric Callahan --- moonraker/authorization.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/moonraker/authorization.py b/moonraker/authorization.py index 6a3882d..e03ca7e 100644 --- a/moonraker/authorization.py +++ b/moonraker/authorization.py @@ -71,12 +71,13 @@ class Authorization: "/access/oneshot_token", ['GET'], self._handle_token_request, protocol=['http']) - async def _handle_apikey_request(self, path, method, args): - if method.upper() == 'POST': + async def _handle_apikey_request(self, web_request): + action = web_request.get_action() + if action.upper() == 'POST': self.api_key = self._create_api_key() return self.api_key - async def _handle_token_request(self, path, method, args): + async def _handle_token_request(self, web_request): return self.get_access_token() def _read_api_key(self):