relocate(event.buildLink is not working properly

I am working in an application, where user can use their customized
sub-domain (http://xxx.mydomain.com or http://xyz.mydomain.com ..etc).
User can access this application only after login. So onRequestStart I
am checking whether user is logged in or not, if not redirecting him
to login page using " relocate(event.buildLink('main.login')); ".
This relocation is not properly.

For example, I am in any one of the page of xxx sub domain [http://
xxx.mydomain.com/anypage]. Then if I tried to access another sub-
domain [http://XYZ.mydomain.com], it is redirecting me to xxx sub-
domain's login page instead of XYZ's.

If I re-init the framework ( http://XYZ.mydomain.com/?fwreinit=password
) , it is redirecting me to correct login page. Is not sure how to
solve this? Am I missing something?

Would it not be better to use the security interceptor for this?

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of CF Mitrah
Sent: Thursday, 4 August 2011 11:54 PM
To: ColdBox Platform
Subject: [coldbox:11031] relocate(event.buildLink is not working properly

I am working in an application, where user can use their customized sub-
domain (http://xxx.mydomain.com or http://xyz.mydomain.com ..etc).
User can access this application only after login. So onRequestStart I am
checking whether user is logged in or not, if not redirecting him to login

page

using " relocate(event.buildLink('main.login')); ".
This relocation is not properly.

For example, I am in any one of the page of xxx sub domain [http://
xxx.mydomain.com/anypage]. Then if I tried to access another sub- domain
[http://XYZ.mydomain.com], it is redirecting me to xxx sub- domain's login
page instead of XYZ's.

If I re-init the framework ( http://XYZ.mydomain.com/?fwreinit=password
) , it is redirecting me to correct login page. Is not sure how to solve

this? Am I

Ya, I am still using old school methods. I may use security
interceptors in my future project :slight_smile:

Anyway to solve this issue?

And event.buildLink is for building links not redirection. You should be
thinking about routes like nextRoute or nextEvent depending on what version
of ColdBox you are running.

You're right you are in old school method.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of CF Mitrah
Sent: Friday, 5 August 2011 12:09 AM
To: ColdBox Platform
Subject: [coldbox:11033] Re: relocate(event.buildLink is not working

properly

Ya, I am still using old school methods. I may use security interceptors

in my