Index: /extensions/oAuth/include/hybridauth/Hybrid/Storage.php
===================================================================
--- /extensions/oAuth/include/hybridauth/Hybrid/Storage.php	(revision 20368)
+++ /extensions/oAuth/include/hybridauth/Hybrid/Storage.php	(revision 20369)
@@ -28,8 +28,8 @@
 
 		if( $value ){
-			$_SESSION["HA::CONFIG"][$key] = $value; 
+			$_SESSION["HA::CONFIG"][$key] = serialize($value); 
 		}
 		elseif( isset( $_SESSION["HA::CONFIG"][$key] ) ){ 
-			return $_SESSION["HA::CONFIG"][$key];  
+			return unserialize($_SESSION["HA::CONFIG"][$key]);  
 		}
 
@@ -42,5 +42,5 @@
 
 		if( isset( $_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key] ) ){ 
-			return $_SESSION["HA::STORE"][$key];  
+			return unserialize($_SESSION["HA::STORE"][$key]);  
 		}
 
@@ -52,5 +52,5 @@
 		$key = strtolower( $key ); 
 
-		$_SESSION["HA::STORE"][$key] = $value; 
+		$_SESSION["HA::STORE"][$key] = serialize($value); 
 	}
 
Index: /extensions/oAuth/main.inc.php
===================================================================
--- /extensions/oAuth/main.inc.php	(revision 20368)
+++ /extensions/oAuth/main.inc.php	(revision 20369)
@@ -117,7 +117,17 @@
   
   // in case of registration aborded
-  if (script_basename() != 'register')
+  if ( script_basename() != 'register' and ($data=pwg_get_session_var('oauth_new_user')) !== null )
   {
     pwg_unset_session_var('oauth_new_user');
+    
+    require_once(OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php');
+    
+    try {
+      $hybridauth = new Hybrid_Auth($hybridauth_conf);
+      $adapter = $hybridauth->getAdapter($data[0]);
+      $adapter->logout();
+    }
+    catch (Exception $e) {
+    }
   }
 }
Index: /extensions/oAuth/template/identification_common.tpl
===================================================================
--- /extensions/oAuth/template/identification_common.tpl	(revision 20368)
+++ /extensions/oAuth/template/identification_common.tpl	(revision 20369)
@@ -1,4 +1,3 @@
-{html_head}{literal}
-<style type="text/css">
+{html_style}{literal}
   #openid_form {
     padding:20px;
@@ -13,22 +12,23 @@
     font-weight:bold;
   }
-</style>
-{/literal}{/html_head}
+{/literal}{/html_style}
 
 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
 {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
 
-{footer_script}
+{footer_script}{literal}
 // redirect, called from the popup
-function redirect(type) {ldelim}
+function redirect(type) {
+{/literal}
   url = "{$REDIRECT_TO}";
   if (typeof type != 'undefined' && type != 'default') {ldelim}
     url = "{$ABS_ROOT_URL}"+ type +".php";
   }
+{literal}
   window.location.href = url;
 }
 
 // open authentication popup
-function open_auth(url) {ldelim}
+function open_auth(url) {
   window.open(
     url+ "&t=" + (new Date()).getTime(), 
@@ -39,10 +39,11 @@
 
 // click on a button
-$("a.oauth").click(function() {ldelim}
+$("a.oauth").click(function() {
   var idp = $(this).attr('title');
   
-  switch(idp) {ldelim}
+  switch(idp) {
     case 'OpenID': case 'Wordpress': case 'Flickr':
-      switch(idp) {ldelim}
+      switch(idp) {
+{/literal}
         case 'OpenID':
           $("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break;
@@ -50,20 +51,23 @@
           $("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break;
       }
-  
+      
       $("#openid_form").css('background-color', $("#the_page #content").css('background-color'));
       $("#openid_form img").attr('src', '{$ROOT_URL}{$OAUTH_PATH}template/icons/38px/'+ idp.toLowerCase() +'.png');
       $("#openid_form h3").html(idp);
       $("#openid_form").data('idp', idp);
-      
-      $.colorbox({ldelim}
+{literal}  
+      $.colorbox({
         inline:true,
         href:"#openid_form",
         initialWidth:0,
-        initialHeight:0
+        initialHeight:0,
+        onComplete:function(){ $.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded
       })
       break;
       
     default:
+{/literal}
       open_auth("{$OAUTH_URL}"+ idp);
+{literal}
   }
   
@@ -71,5 +75,5 @@
 });
 
-$("#openid_form").submit(function() {ldelim}
+$("#openid_form").submit(function() {
   var idp = $(this).data('idp');
   var oi = $("#openid_form input[name='openid_identifier']").val();
@@ -77,30 +81,31 @@
   
   $("#openid_label").removeClass('error');
-  if (!oi) {ldelim}
+  if (!oi) {
     $("#openid_label").addClass('error');
     return false;
   }
   
-  switch(idp) {ldelim}
+  switch(idp) {
     case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break;
     case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break;
   }
-  
+{/literal}  
   open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));
+{literal}
   $.colorbox.close();
   return false;
 });
 
-$("#openid_cancel").click(function() {ldelim}
+$("#openid_cancel").click(function() {
   $("#openid_label").removeClass('error');
   $.colorbox.close();
   return false;
 });
-{/footer_script}
+{/literal}{/footer_script}
 
 <div style="display:none;">
   <form id="openid_form" action="">
     <div>
-      <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png">
+      <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png" style="width:38px:height:38px;">
       <h3>OpendID</h3>
     </div>
Index: /extensions/oAuth/template/identification_menubar.tpl
===================================================================
--- /extensions/oAuth/template/identification_menubar.tpl	(revision 20368)
+++ /extensions/oAuth/template/identification_menubar.tpl	(revision 20369)
@@ -4,6 +4,5 @@
     {include file=$OAUTH_ABS_PATH|@cat:'template/identification_common.tpl'}
   {/if}
-  {html_head}{literal}
-  <style type="text/css">
+  {html_style}{literal}
     dl#mbIdentification dd:first-of-type {
       padding-bottom:0 !important;
@@ -12,6 +11,5 @@
       margin:0 1px;
     }
-  </style>
-  {/literal}{/html_head}
+  {/literal}{/html_style}
   
   <dd>
Index: /extensions/oAuth/template/identification_page.tpl
===================================================================
--- /extensions/oAuth/template/identification_page.tpl	(revision 20368)
+++ /extensions/oAuth/template/identification_page.tpl	(revision 20369)
@@ -3,11 +3,9 @@
   {include file=$OAUTH_ABS_PATH|@cat:'template/identification_common.tpl'}
 {/if}
-{html_head}{literal}
-<style type="text/css">
+{html_style}{literal}
   #oauth_wrap .oauth {
     margin:0 2px;
   }
-</style>
-{/literal}{/html_head}
+{/literal}{/html_style}
   
 <fieldset style="text-align:center;" id="oauth_wrap">
