Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
9822: Check *all* cookies (not just the last cookie) for a notebook t…
Browse files Browse the repository at this point in the history
…oken
  • Loading branch information
Jason Grout committed Sep 29, 2010
1 parent 3da2cae commit ed1c4f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sagenb/notebook/guard.py
Expand Up @@ -260,15 +260,13 @@ def getCredentials(self, request):
if request.args.get('startup_token', [''])[0]:
import avatars
return avatars.TokenCred(request.args.get('startup_token', [''])[0])
username = password = 'COOKIESDISABLED'
if request.headers.getHeader('cookie'):
for C in request.headers.getHeader('cookie'):
if C.name == 'cookie_test_%s' % twist.notebook.port:
username = request.args.get('email', [''])[0]
password = request.args.get('password', [''])[0]
else:
username = password = 'COOKIESDISABLED'
else:
username = password = 'COOKIESDISABLED'
break
return credentials.UsernamePassword(username, password)

def _loginSuccess(self, (iface, rsrc, logout), session, creds, segments):
Expand Down

0 comments on commit ed1c4f6

Please sign in to comment.