cloudant-labs / cloudant-python

Asynchronous Cloudant / CouchDB interface for Python
http://cloudant-labs.github.io/cloudant-python/
37 stars 17 forks source link

Instance on connection should re-login when required. #3

Closed mikerhodes closed 10 years ago

mikerhodes commented 10 years ago

connection.login(username, password) logs a user into a Cloudant account and gets the cookie back. Eventually this cookie will expire.

We need to consider the API consumer experience around when the cookie expires and the user is logged out, but the instance of the connection is still present. Do we want to transparently log the user in again if a request fails because the cookie is no longer valid (where logging in = get a new cookie)?

garbados commented 10 years ago

Unsure how to do this elegantly. Punting on it until a solution emerges.

garbados commented 10 years ago

Fixed: https://github.com/cloudant-labs/cloudant-python/blob/master/cloudant/account.py#L25-L30