Permalink
Browse files

Merge pull request #58 from mihneasim/master

Using decorators for setting callbacks
  • Loading branch information...
maxcountryman committed Apr 2, 2013
2 parents 8aecdf6 + 29b2574 commit 59f7cd74a47806aebfbfaefb39daa78529063609
Showing with 4 additions and 0 deletions.
  1. +4 −0 flask_login.py
View
@@ -201,6 +201,7 @@ def user_loader(self, callback):
:param callback: The callback for retrieving a user object.
"""
self.user_callback = callback
+ return callback
def token_loader(self, callback):
"""
@@ -212,6 +213,7 @@ def token_loader(self, callback):
:param callback: The callback for retrieving a user object.
"""
self.token_callback = callback
+ return callback
def setup_app(self, app, add_context_processor=True):
"""
@@ -249,6 +251,7 @@ def unauthorized_handler(self, callback):
:param callback: The callback for unauthorized users.
"""
self.unauthorized_callback = callback
+ return callback
def unauthorized(self):
"""
@@ -286,6 +289,7 @@ def needs_refresh_handler(self, callback):
:param callback: The callback for unauthorized users.
"""
self.needs_refresh_callback = callback
+ return callback
def needs_refresh(self):
"""

0 comments on commit 59f7cd7

Please sign in to comment.