Skip to content

Commit

Permalink
Set secure to not app.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Siecje committed Sep 26, 2017
1 parent 1ab1112 commit 264eb7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ def login():
resp = make_response(redirect(target))

secure = True if app.debug is False else False
# Secure limits cookies to HTTPS traffic only.
# HttpOnly prevents JavaScript from reading the cookie
resp.set_cookie('token', auth_token,
secure=app.debug,
httponly=True)
secure=secure,
httponly=True,
)

# Set headers that will be received by the service for this request
resp.headers['Location'] = target
Expand Down

0 comments on commit 264eb7a

Please sign in to comment.