summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/static/src/js
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2013-04-11 09:37:08 +0200
committerRaphael Collet <rco@openerp.com>2013-04-11 09:37:08 +0200
commit894eeef8e0ff44b2bf0b276718e6f48a0a7c1ee6 (patch)
tree4ae49603ad9be6364b2aee9c3134c2a71be294b8 /addons/auth_oauth/static/src/js
parentfb4b655139d5a00f605ea954dfee2df77e457778 (diff)
parenta0a9ae61e7e41607aa9f6c918f003fd5699ffa4c (diff)
[MERGE] from trunk
bzr revid: rco@openerp.com-20130411073708-gaxl2332umtedmg6
Diffstat (limited to 'addons/auth_oauth/static/src/js')
-rw-r--r--addons/auth_oauth/static/src/js/auth_oauth.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js
index 7ee83bd99e9..131ae5c1c42 100644
--- a/addons/auth_oauth/static/src/js/auth_oauth.js
+++ b/addons/auth_oauth/static/src/js/auth_oauth.js
@@ -5,6 +5,7 @@ openerp.auth_oauth = function(instance) {
start: function(parent, params) {
var self = this;
var d = this._super.apply(this, arguments);
+ this.$el.hide();
this.$el.on('click', 'a.zocial', this.on_oauth_sign_in);
this.oauth_providers = [];
if(this.params.oauth_error === 1) {
@@ -24,6 +25,8 @@ openerp.auth_oauth = function(instance) {
var db = this.$("form [name=db]").val();
if (db) {
this.rpc("/auth_oauth/list_providers", { dbname: db }).done(this.on_oauth_loaded);
+ } else {
+ this.$el.show();
}
},
on_oauth_loaded: function(result) {
@@ -32,6 +35,7 @@ openerp.auth_oauth = function(instance) {
if (this.oauth_providers.length === 1 && params.type === 'signup') {
this.do_oauth_sign_in(this.oauth_providers[0]);
} else {
+ this.$el.show();
this.$('.oe_oauth_provider_login_button').remove();
var buttons = QWeb.render("auth_oauth.Login.button",{"widget":this});
this.$(".oe_login_pane form ul").after(buttons);
@@ -57,7 +61,7 @@ openerp.auth_oauth = function(instance) {
state: JSON.stringify(state),
};
var url = provider.auth_endpoint + '?' + $.param(params);
- window.location = url;
+ instance.web.redirect(url);
},
_oauth_state: function(provider) {
// return the state object sent back with the redirected uri