From 73564b97ea6d1e8db88ef5df9c7b59b8c289a733 Mon Sep 17 00:00:00 2001 From: Joshua Milas Date: Mon, 11 Sep 2017 12:16:17 -0400 Subject: [PATCH] Updated the whoami-flask example --- examples/service-whoami-flask/whoami-flask.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/service-whoami-flask/whoami-flask.py b/examples/service-whoami-flask/whoami-flask.py index 56b435a4..03ad8fcf 100644 --- a/examples/service-whoami-flask/whoami-flask.py +++ b/examples/service-whoami-flask/whoami-flask.py @@ -28,8 +28,11 @@ def authenticated(f): @wraps(f) def decorated(*args, **kwargs): cookie = request.cookies.get(auth.cookie_name) + token = request.headers.get(auth.auth_header_name) if cookie: user = auth.user_for_cookie(cookie) + elif token: + user = auth.user_for_token(token) else: user = None if user: