summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/static/src
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-08-16 00:47:08 +0200
committerAntony Lesuisse <al@openerp.com>2012-08-16 00:47:08 +0200
commit23178302c4c44034e0bf6b6b1ea1a60d42e7d41c (patch)
tree83317334646cb394af01b2b6783719d02da3a9e0 /addons/auth_oauth/static/src
parent35e620ce688d07fd7ff6b0f50510c2c9301d2c7a (diff)
oauth generic with buttons from zocial
bzr revid: al@openerp.com-20120815224708-rcge3914klkwrw6u
Diffstat (limited to 'addons/auth_oauth/static/src')
-rw-r--r--addons/auth_oauth/static/src/css/auth_oauth.css2
-rw-r--r--addons/auth_oauth/static/src/js/auth_oauth.js11
-rw-r--r--addons/auth_oauth/static/src/xml/auth_oauth.xml4
3 files changed, 8 insertions, 9 deletions
diff --git a/addons/auth_oauth/static/src/css/auth_oauth.css b/addons/auth_oauth/static/src/css/auth_oauth.css
deleted file mode 100644
index c8e0efe4c32..00000000000
--- a/addons/auth_oauth/static/src/css/auth_oauth.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.oe_login_oauth {
-} \ No newline at end of file
diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js
index 67b446a4580..eae423fae1f 100644
--- a/addons/auth_oauth/static/src/js/auth_oauth.js
+++ b/addons/auth_oauth/static/src/js/auth_oauth.js
@@ -4,7 +4,7 @@ openerp.auth_oauth = function(instance) {
instance.web.Login = instance.web.Login.extend({
start: function(parent, params) {
var d = this._super.apply(this, arguments);
- this.$element.on('click', 'a.oe_oauth_sign_in', this.on_oauth_sign_in);
+ this.$element.on('click', 'a.zocial', this.on_oauth_sign_in);
this.oauth_providers = [];
if(this.params.oauth_error === 1) {
this.do_warn("Sign up error.","Sign up is not allowed on this database.");
@@ -26,20 +26,23 @@ openerp.auth_oauth = function(instance) {
console.log(buttons);
this.$(".oe_login_pane form ul").after(buttons);
},
- oauth_url: function(state) {
- },
on_oauth_sign_in: function(ev) {
ev.preventDefault();
var index = $(ev.target).data('index');
var p = this.oauth_providers[index];
var ret = location.protocol+"//"+location.host+"/";
var dbname = self.$("form [name=db]").val();
+ var state_object = {
+ d: dbname,
+ p: p.id
+ }
+ var state = JSON.stringify(state_object);
var params = {
response_type: 'token',
client_id: p.client_id,
redirect_uri: ret,
scope: p.scope,
- state: dbname,
+ state: state,
};
var url = p.auth_endpoint + '?' + $.param(params);
window.location = url;
diff --git a/addons/auth_oauth/static/src/xml/auth_oauth.xml b/addons/auth_oauth/static/src/xml/auth_oauth.xml
index 494dc20e1a1..c2693804e59 100644
--- a/addons/auth_oauth/static/src/xml/auth_oauth.xml
+++ b/addons/auth_oauth/static/src/xml/auth_oauth.xml
@@ -2,9 +2,7 @@
<templates id="template" xml:space="preserve">
<t t-name="auth_oauth.Login.button">
<t t-foreach="widget.oauth_providers" t-as="p">
- <a href="#" class="oe_oauth_sign_in" t-att-data-index="p_index">
- Login with <t t-esc="p.name"/> icon <t t-esc="p.icon_url"/>
- </a>
+ <a href="#" t-att-class="p.css_class" t-att-data-index="p_index"><t t-esc="p.body"/></a>
<br/>
</t>
</t>