Closed (fixed)
Project:
HybridAuth Social Login
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Oct 2013 at 05:29 UTC
Updated:
24 Oct 2013 at 12:30 UTC
From #2067053: Popup window size (width and height).
**********
Hi,
I am using Hybrid Auth -7.x-2.7.
I need a custom popup instead of the current window type. I am using lightbox module and also ctools module. I found in your module that a js file from cTools module should be included to get the modal dialog.
Can you explain the procedure or provide a link so that I can learn myself.
Thanks,
Kiran
**********
Is there any solution for this?
Can't we use custom popups for the HybridAuth logins?
Comments
Comment #1
kirantej_p commentedHi Andy,
Can you provide any reply for that. I have been looking around to find a solution. Could you provide some documentation for it.
Thanks,
Kiran
Comment #2
duozerskKiran,
As I understood, you want to have authentication provider login/confirmation window to open in a custom modal window (not the 2 types provided by the module - usual popup window and the current window). Please confirm that this is what you want to achieve.
Side note: the ctools modal is used by this module to provide 2 widget types - one single icon or a link leading to the modal with the authentication providers icons.
For the options you have (lightbox and ctools modal) - ctools modal can't open external sites' content in it, only content from your site can be opened in it. You can try to make what you want using the lightbox. To change what happens when a user clicks on the authentication provider link you should modify the '#hybridauth_onclick' property of the widget element to contain the custom js code that will open the link in the lightbox modal.
The module itself uses this js code to open a usual popup.
You should modify this to open a lightbox modal (provided that the lightbox library is already present on the page).
Hope it helps.
Another note - it might be a good idea to add support for different popular modals to this module, I will think about it.
Thanks
AndyB
Comment #3
kirantej_p commentedThanks Andy, This is what I am looking for. I will try to include lightbox modal and will reply you back.
Thanks again.
Comment #4
kirantej_p commentedHey, I tried Lightbox module. I have modified some code in the hybridauth.theme.inc file. It comes with a lightbox popup and it is logging in an iframe, but the problem is the popup window is not closed and the site itself is opening in that Lightbox popup.
Comment #5
duozerskKiran,
Good-good, glad it helped you to get started. But you'd better not hack the module files ;) There are other ways to achieve what you need in Drupal - form alters (to change the '#hybridauth_onclick' property as I indicated above) and theme functions overriding.
Anyway, could you please post the code you used so that I can test it and commit to the main stream?
To make the site to dismiss the modal window and open in the main window we need to change the hybridauth_window_close() function - hybridauth.pages.inc file, line 67 - we need to modify the JS code added there to determine the parent and change its location.
Thanks
AndyB
Comment #6
kirantej_p commentedHi,
Just added this in the foreach loop removed
'rel' => array('nofollow')and added'rel' => array('lightframe')to get the lightbox iframe functionality, in hybridauth.theme.inc file. Also made $onclick value as null.The problem here is, it is opening as an iframe, so the site also loads in it after successful authentication.
This is all what I did and I am struck here. Just post here if you are having any new update about this.
Thanks,
Kiran
Comment #7
duozerskCommitted - http://drupalcode.org/project/hybridauth.git/commit/4d6192a
Please download the snapshot release from this commit - http://drupalcode.org/project/hybridauth.git/snapshot/4d6192a.tar.gz - update the module code and then set the Authentication window type to "Lightbox2" in the HybridAuth module settings.
Thanks
AndyB
Comment #8
duozerskSome notes: my tests have shown that some authentication providers (Twitter, LinkedIn) won't work inside an iframe - be careful with that.
Thanks
AndyB
Comment #9
duozerskLast commit - http://drupalcode.org/project/hybridauth.git/commit/8c82cf2 - adds support for shadowbox and fancybox.
AndyB
Comment #10
kirantej_p commentedHi,
Thanks for your commits and fast response. It is not working for Google also. It is working for Facebook. The login is facebook is happening but on success, it is not reloaded or the pop up is not closing. This is the same situation I faced yesterday.
Thanks,
Kiran
Comment #11
duozerskKiran,
This is strange... cause it works when I test it. Could you please download the latest dev release from http://drupalcode.org/project/hybridauth.git/snapshot/8c82cf2.tar.gz and try it? It might also be related to browser cache...
Thanks
AndyB
Comment #12
kirantej_p commentedYes, It is browser cache problem. It is perfectly working for Facebook, but for Google, it is not accepting to load in an iframe.
Thanks,
Kiran
Comment #13
duozerskYep, and there is nothing we can actually do about it... Google should go either through the same window or the popup window. Probably it would be good to make the "Authentication window type" setting per provider.
AndyB
Comment #14
duozerskFollow-up issue - #2109005: Authentication window type per provider
Comment #15
kirantej_p commentedYes. Authentication window type based on provider is good.
Comment #16.0
(not verified) commentedUpdated the related issue title