cubicweb/repoapi.py
changeset 11195 5de859b95988
parent 11057 0b59724cb3f2
child 12032 c16c1805e973
--- a/cubicweb/repoapi.py	Wed Mar 09 14:11:47 2016 +0100
+++ b/cubicweb/repoapi.py	Thu Jun 12 15:54:44 2014 +0200
@@ -47,11 +47,7 @@
     """Take credential and return associated Connection.
 
     raise AuthenticationError if the credential are invalid."""
-    sessionid = repo.connect(login, **kwargs)
-    session = repo._get_session(sessionid)
-    # XXX the autoclose_session should probably be handle on the session directly
-    # this is something to consider once we have proper server side Connection.
-    return Connection(session)
+    return repo.new_session(login, **kwargs).new_cnx()
 
 def anonymous_cnx(repo):
     """return a Connection for Anonymous user.