Tweak user_redirect_hook API

- Pass in user object & request object only explicitly.
  Much better interface that is harder to break by internal
  refactoring. We can always add more  parameters if needed?
This commit is contained in:
YuviPanda
2019-10-21 14:29:59 -07:00
parent 3df4afe7af
commit b4a760234e
3 changed files with 11 additions and 8 deletions

View File

@@ -1488,7 +1488,7 @@ class UserRedirectHandler(BaseHandler):
# processing
url = None
if self.app.user_redirect_hook:
url = await self.app.user_redirect_hook(self, path)
url = await maybe_future(self.app.user_redirect_hook(self.request, self.current_user))
if url is None:
user = self.current_user
user_url = url_path_join(user.url, path)