Modify authentifcation couchdb function