File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ def __init__(self):
7777 self .cookies .load ()
7878 self .cookies .clear_expired_cookies ()
7979
80+ def clear (self , domain ):
81+ """Clear cookies for the specified domain."""
82+ try :
83+ self .cookies .clear (domain )
84+ self .cookies .save ()
85+ except KeyError :
86+ pass
87+
8088 def git_root (self ):
8189 """
8290 Return the absolute path from the git repository root
@@ -300,6 +308,8 @@ def auth_login(self, args):
300308 password = getpass ('password: ' )
301309 url = urlparse .urljoin (controller , '/api/auth/login/' )
302310 payload = {'username' : username , 'password' : password }
311+ # clear any cookies for this controller's domain
312+ self ._session .clear (urlparse .urlparse (url ).netloc )
303313 # prime cookies for login
304314 self ._session .get (url , headers = headers )
305315 # post credentials to the login URL
You can’t perform that action at this time.
0 commit comments