Topic-icon SCLogin button not working on subdomains!

Active Subscriptions:

None
8 years 6 months ago - 8 years 6 months ago #55212 by SIMTANDA
SCLogin button not working on af.heartslovefree.com/

System page caching is already disabled, so how do i fix this?

af.heartslovefree.com/:1 XMLHttpRequest cannot load heartslovefree.com/hlf/modules/mod_sclogin/ajax/otpcheck.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'af.heartslovefree.com' is therefore not allowed access.
Last edit: 8 years 6 months ago by SIMTANDA.
The topic has been locked.
Support Specialist
8 years 6 months ago #55220 by alzander
I'm not seeing the issue you report on your site. Are you still having this problem?

The file that's attempting to be loaded is used when you have 2-factor authentication enabled on your site. If you do, then the Javascript will call that file to see if the user that is authenticating has 2FA enabled and, if so, show the code box.

I hope that helps explain the problem you reported. If you are still having issues, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 6 months ago - 8 years 6 months ago #55227 by SIMTANDA
Hi and thanks for the reply,

I have disabled 2FO, but the issue persists.

I think my issue lies with my configuration file in public $live_site = 'www.heartslovefree.com';.

01. ( public $live_site = 'www.heartslovefree.com';. ): My main domain and extensions works perfect, but my subdomains don’t.

SUBDOMAINS ISSUE: SCLogin extension login button does not respond and JFBConnect extension login works perfect, but redirects to my live_site ( www.heartslovefree.com ).

COMMENT: This is not cool, because a user registering and logging in on da.heartslovefree.com should stay on da.heartslovefree.com unless they switch language with extension Gtranslate.



02. ( public $live_site = '/';. ):

ISSUE: SCLogin extension login button works perfect and JFBConnect extension login works only with facebook login and not with Google+, Instagram and Yahoo. Plus Jomsocial extension account activation e-mails have broken links:


✉ Hearts Love Free
_______________________________________
Hello Gizmo,

Thank you for registering at NEW & 100% FREE ► International dating | HEARTS LOVE FREE. Your account is created and must be activated before you can log in.
To activate the account, click on the following link or copy-&-paste it in your browser:
/index.php?option=com_community&view=register&task=activate&token=88645b0a4ebfdd6a83f6b0fc8e15f6bf

After activation you may login to / using your username and password.
________________________________________

This email was sent to Gizmo ( This email address is being protected from spambots. You need JavaScript enabled to view it. ). If you do not wish to receive these emails from Hearts Love Free, you can unsubscribe here. NEW & 100% FREE ► International dating | HEARTS LOVE FREE



03. ( public $live_site = '';. ):

ISSUE: My website and subdomains ads joomla folder path to URL /hlf/.

SUBDOMAINS ISSUE: SCLogin extension login button does not respond and JFBConnect extension login does not work.

DOMAIN ISSUE: SCLogin extension login button works perfect, but JFBConnect extension login does not work.

CONCLUSION: What’s the right setting and / or configuration?

Best regards Hans Simtanda Caspersen - See more at: gtranslate.net/forum/public-live-site-issues-t4396.html#p19406
Last edit: 8 years 6 months ago by SIMTANDA.
The topic has been locked.
Support Specialist
8 years 6 months ago #55243 by alzander
For Joomla login from a subdomain, the issue is due to browser security issues. When the OTP Javascript file is attempted to be loaded, the following error appears in the browsers Javascript error log:

XMLHttpRequest cannot load www.heartslovefree.com/modules/mod_sclogin/ajax/otpcheck.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'da.heartslovefree.com' is therefore not allowed access.

However, I'm not sure why the www version of that file is trying to be loaded. How do you have your sub-domains setup to work with your main site? If you're using a 3rd party extension to manage the subdomains while having all content loaded from your 'main' www site, you may need to contact them. The SCLogin module is simply asking 'what is my domain' and trying to load our OTP file from that domain. On your site, even in the sub-domain directory, that question about the domain seems to be returning the www domain instead of the da. one, which isn't right.

As for the $live_site variable, again, this probably should be left blank. The $live_site variable is used by Joomla to 'force' your domain to something instead of using it's auto-detection feature. Since your domain changes, I wouldn't recommend hard-coding it to any value or these types of issues will arise. It should never be a relative path, like /, but only a fully qualified URL.. or, as I'd think, just blank.

So, if you could, let us know a lot more about how the sub-domains feature, language detection and redirection to those domains, and anything else related are working and we can gladly help try to narrow things down further from there.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 6 months ago #55252 by SIMTANDA
Hi and thanks a lot for the support.

Yes, I am using a 3rd party extension to generate my multilingual subdomains called Gtranslate Enterprise. You can read about this on gtranslate.net/features

Also check out > gtranslate.net/forum/public-live-site-is...6c44eb4c0b9dcc6a4984

My $live_site variable is now set to blank, which means that my domain is now adding my Joomla folder in the path: heartslovefree.com/2015/

PS: I found this thread on Google, but its too complex for me. Anyway, I think you guys can decode it!
jvaneyck.wordpress.com/2014/01/07/cross-...uests-in-javascript/
The topic has been locked.
Support Specialist
8 years 6 months ago #55266 by alzander
The $live_site variable should be blank since you're using multiple subdomains, otherwise your subdomains will always redirect to whatever you have configured for your variable.

JFBConnect should just be asking the site for the current domain and URL. I understand you're using GTranslate, but I have no clue how it creates multiple subdomains or how it's altering how Joomla functions.

In our SCLogin module, we have the following line of code:
sclogin.base = '" . JURI::base() . "';\n"
That should be setting the base URL for your Joomla site, which should be the current domain. On your sub-domain, however, that's returning:
sclogin.base='http://heartslovefree.com/hlf2015/';
JURI::base() is a core Joomla function. You can read about it below:
docs.joomla.org/JURI/base

Something is altering the behavior of JURI::base to return the wrong information. I don't know what is causing that or why it's returning the wrong URL, but it will need to be fixed as that's whats causing your issues. You may want to ask the GTranslate developers if they understand (or are causing) the JURI::base behavior that we're seeing as it may help explain things.

I hope that helps get you started and understanding the issue better. I'm sorry I don't have a magic bullet answer, but on the root/normal domain, things do seem to work. It's whatever is creating those subdomains that seems to be problematic.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 6 months ago #55296 by SIMTANDA
Hi Alex,

the Gtranslate team has replied with the following answer and as a result have moved my site to root directory, so now we want to know which files to edit in order to make below suggestion work:


Hi,

Try to change sclogin.base = '" . JURI::base() . "';\n" to sclogin.base = '" . JURI::base(true) . "/';\n".

I think currently www.heartslovefree.com/ is being redirected internally to www.heartslovefree.com/hlf2015/ that is why you see sclogin.base='heartslovefree.com/hlf2015/'; as a result on www.heartslovefree.com/

We want you to have relative URL for sclogin.base, so when you make the change you will end up having:
sclogin.base='/hlf2015/';

Which hopefully will solve the issue.

You may ask Alex about which file should be modified.

BTW. If you are going to move hlf2015 folder contents to root, it would be better if you do it now, to avoid confusion later.

Thanks!
Regards,

Edvard Ananyan - GTranslate Team
- See more at: gtranslate.net/forum/public-live-site-is...sthash.etAbdej8.dpuf
The topic has been locked.
Support Specialist
8 years 6 months ago #55307 by alzander
That line of code is in the /modules/mod_sclogin/helper.php file at line 153. You'll see something like:
sclogin.base = '" . JURI::base() . "';\n"
Per their instructions, change it to:
sclogin.base = '" . JURI::base(true) . "';\n"
We use JURI::base(true) in other sections of our code, and that should work, but you'll want to make sure you try from various different URLs on your site since a relative path may have issues with SEF URLs.

Keep us posted on how that goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 6 months ago - 8 years 6 months ago #55311 by SIMTANDA
That did the trick!

Finally, when i login with social login buttons such as facebook or Google+ from example this subdomain da.heartslovefree.com/ i succeed, but i am then redirected to my main domain and from there i can successfully switch language and is successfully redirected to the subdomain with that particular language.

I prefer though to login with social login buttons such as facebook or Google+ from a subdomain and stay on that subdomain after successful login. So witch line of code shall i modify next?
Last edit: 8 years 6 months ago by SIMTANDA.
The topic has been locked.