better reload

This commit is contained in:
2021-09-17 19:15:53 +03:00
parent af3afecce8
commit a7a32f0080
5 changed files with 27 additions and 7 deletions

View File

@ -35,6 +35,14 @@ class ReloadAuthView(BaseView):
:return: 204 on success
"""
self.configuration.reload()
self.request.app["validator"] = Auth.load(self.configuration)
try:
import aiohttp_security # type: ignore
self.request.app[aiohttp_security.api.AUTZ_KEY].validator =\
self.request.app["validator"] =\
Auth.load(self.configuration)
except (ImportError, KeyError):
self.request.app.logger.warning("could not update authentication module validator", exc_info=True)
raise
return HTTPNoContent()