avelino / bottle-auth

Bootle authentication, for Personal, Google, Twitter and facebook
https://pypi.python.org/pypi/bottle-auth
MIT License
29 stars 12 forks source link

Decorator login not working as expected #5

Closed hmarrao closed 10 years ago

hmarrao commented 10 years ago

The decorator login isn't working as a decorator:

couldn't get this to work:

@sme_auth_app.route('/') @login(auth) def home(auth):

but

@sme_auth_app.route('/')

@login()

def home(auth): user = auth.get_user(request.environ)

works fine.

iurisilvio commented 10 years ago

You can use the apply keyword:

@sme_auth_app.route('/', apply=[login()])
def home(auth):
    user = auth.get_user(request.environ)
hmarrao commented 10 years ago

that's the working usage that Im using also but still it is a bug in the code package no¿?

avelino commented 10 years ago

i install via git:

pip install -e git+https://github.com/Avelino/bottle-auth.git#egg=bottle-auth

avelino commented 10 years ago

Fixed in #8