fbpx

SCLogin button not working on subdomains!

SCLogin button not working on subdomains!

SCLogin button not working on http://af.heartslovefree.com/

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

af.heartslovefree.com/:1 XMLHttpRequest cannot load http://heartslovefree.com/hlf/modules/m … check.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://af.heartslovefree.com' is therefore not allowed access.

Edited by: SIMTANDA - Oct-14-15 15:56:20
SIMTANDA
useravatar
Offline
9 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24393 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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 = 'http://www.heartslovefree.com';.

01. ( public $live_site = 'http://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 ( http://www.heartslovefree.com ).

COMMENT: This is not cool, because a user registering and logging in on http://da.heartslovefree.com should stay on http://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 ( [email protected] ). 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: http://gtranslate.net/forum/public-live … tml#p19406

Edited by: SIMTANDA - Oct-16-15 10:37:49
SIMTANDA
useravatar
Offline
9 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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 http://www.heartslovefree.com/modules/m … check.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://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

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24393 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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 http://gtranslate.net/features

Also check out > http://gtranslate.net/forum/public-live … 9dcc6a4984

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

PS: I found this thread on Google, but its too complex for me. Anyway, I think you guys can decode it!
https://jvaneyck.wordpress.com/2014/01/ … avascript/

SIMTANDA
useravatar
Offline
9 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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:

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:

Code:

sclogin.base='http://heartslovefree.com/hlf2015/';

JURI::base() is a core Joomla function. You can read about it below:
https://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

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24393 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

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 http://www.heartslovefree.com/ is being redirected internally to http://www.heartslovefree.com/hlf2015/ that is why you see sclogin.base='http://heartslovefree.com/hlf2015/'; as a result on http://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: http://gtranslate.net/forum/public-live … bdej8.dpuf

SIMTANDA
useravatar
Offline
9 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

That line of code is in the /modules/mod_sclogin/helper.php file at line 153. You'll see something like:

Code:

                sclogin.base = '" . JURI::base() . "';\n"

Per their instructions, change it to:

Code:

                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

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24393 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: SCLogin button not working on subdomains!

That did the trick!

Finally, when i login with social login buttons such as facebook or Google+ from example this subdomain http://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?

Edited by: SIMTANDA - Oct-22-15 21:56:42
SIMTANDA
useravatar
Offline
9 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11830
Total Polls:
0
Total Posts:
49639
Posts this week:
12
User Info
 
Total Users:
48272
Newest User:
[email protected]
Members Online:
0
Guests Online:
1126

Online: 
There are no members online
Social Stream
Hide, Seek & Defuse

Handheld Electronic Game

Alex from SourceCoast is working on a new electronic game for kids called Countdown. It's a timed game of Hide & Seek with mini-games (Whack-a-Mole, Simon, etc) to complete when you find it.

Hide and Seek Toys