[FIX] portal_anonymous: token and login params are in the URL fragment, not in the query string

The previous test was done on the query string, in which
`token` and `login` are never found, preventin users
from seeing their reset password form.
The test was also incorrectly checking for the presence
of both a `token` and `login`, while any of those should
disable the anonymous mode (sometimes only `token` is
present, e.g. for password reset).

lp bug: https://launchpad.net/bugs/1104070 fixed

bzr revid: odo@openerp.com-20130225155654-0kb9g5zmi8a2ggp4
This commit is contained in:
Olivier Dony
2013-02-25 16:56:54 +01:00
parent 0fe0bf1424
commit 4e96f620e1
@@ -44,9 +44,8 @@ openerp.portal_anonymous = function(instance) {
start: function() {
var self = this;
return $.when(this._super()).then(function() {
var params = $.deparam($.param.querystring());
var dblist = self.db_list || [];
if (!self.session.session_is_valid() && dblist.length === 1 && (!params.token || !params.login)) {
if (!self.session.session_is_valid() && dblist.length === 1 && !(self.params.token || self.params.login)) {
self.remember_credentials = false;
// XXX get login/pass from server (via a rpc call) ?
return self.do_login(dblist[0], 'anonymous', 'anonymous');