Mercurial > libervia-web
comparison src/server/server.py @ 1100:5976dcd42591
pages (g): use server's connect method to connect instead of bridge, this way normal Libervia workflow is used, and session attributes are initialised.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Jun 2018 18:31:29 +0200 |
parents | ea0d41ef3719 |
children | e6ff5530900e |
comparison
equal
deleted
inserted
replaced
1099:ea0d41ef3719 | 1100:5976dcd42591 |
---|---|
1641 | 1641 |
1642 # XXX: all security checks must be done here, even if present in javascript | 1642 # XXX: all security checks must be done here, even if present in javascript |
1643 if login.startswith('@'): | 1643 if login.startswith('@'): |
1644 raise failure.Failure(exceptions.DataError('No profile_key allowed')) | 1644 raise failure.Failure(exceptions.DataError('No profile_key allowed')) |
1645 | 1645 |
1646 if '@' in login: | 1646 if login.startswith('guest@@') and login.count('@') == 2: |
1647 log.debug("logging a guest account") | |
1648 elif '@' in login: | |
1649 if login.count('@') != 1: | |
1650 raise failure.Failure(exceptions.DataError('Invalid login: {login}'.format(login=login))) | |
1647 try: | 1651 try: |
1648 login_jid = jid.JID(login) | 1652 login_jid = jid.JID(login) |
1649 except (RuntimeError, jid.InvalidFormat, AttributeError): | 1653 except (RuntimeError, jid.InvalidFormat, AttributeError): |
1650 raise failure.Failure(exceptions.DataError('No profile_key allowed')) | 1654 raise failure.Failure(exceptions.DataError('No profile_key allowed')) |
1651 | 1655 |