# HG changeset patch # User Goffi # Date 1527870689 -7200 # Node ID 5976dcd4259188c62b92c6a2345f1dd13aceaa53 # Parent ea0d41ef37192fc2283b184dce4e746826aa981e pages (g): use server's connect method to connect instead of bridge, this way normal Libervia workflow is used, and session attributes are initialised. diff -r ea0d41ef3719 -r 5976dcd42591 src/pages/g/page_meta.py --- a/src/pages/g/page_meta.py Fri Jun 01 16:00:48 2018 +0200 +++ b/src/pages/g/page_meta.py Fri Jun 01 18:31:29 2018 +0200 @@ -61,7 +61,7 @@ profile = data['guest_profile'] password = data['password'] try: - yield self.host.bridgeCall("connect", profile, password, {}) + yield self.host.connect(request, profile, password) except Exception as e: log.warning(_(u"Can't connect profile: {msg}").format( msg=e)) @@ -71,7 +71,6 @@ log.info(_(u"guest session started, connected with profile [{profile}]".format( profile = profile))) - sat_session.profile = profile # we copy data useful in templates template_data = request.template_data diff -r ea0d41ef3719 -r 5976dcd42591 src/server/server.py --- a/src/server/server.py Fri Jun 01 16:00:48 2018 +0200 +++ b/src/server/server.py Fri Jun 01 18:31:29 2018 +0200 @@ -1643,7 +1643,11 @@ if login.startswith('@'): raise failure.Failure(exceptions.DataError('No profile_key allowed')) - if '@' in login: + if login.startswith('guest@@') and login.count('@') == 2: + log.debug("logging a guest account") + elif '@' in login: + if login.count('@') != 1: + raise failure.Failure(exceptions.DataError('Invalid login: {login}'.format(login=login))) try: login_jid = jid.JID(login) except (RuntimeError, jid.InvalidFormat, AttributeError):