Confused about route functions ordering

7 views
Skip to first unread message

thenwithexpandedwingshesteershisflight

unread,
Apr 10, 2011, 10:24:23 PM4/10/11
to Sandbar Library
My authentication form doesn't redirect to the URL I hit before the
login page, instead after authentication it sends me to another URL. I
found that the URL it redirects to depends on the order in which my
routes, (GET "/path1/:param1/etc [...) are defined. I can't see the
pattern yet but I don't get why it should matter in what order I
define my routes anyway.

Brenton

unread,
Apr 13, 2011, 12:50:17 AM4/13/11
to Sandbar Library
Where you are redirected has nothing to do with the order of your
routes.

It may be that you are securing pages or resources that you don't
intend to secure. I can't help you without seeing some code.

Please submit an issue on GitHub with some code to reproduce the
problem and I will look into it.

Regards,
Brenton

On Apr 10, 7:24 pm, thenwithexpandedwingshesteershisflight

thenwithexpandedwingshesteershisflight

unread,
Apr 14, 2011, 12:46:21 AM4/14/11
to Sandbar Library
Hi, it's ok I found the problem. It wasn't anything to do with
sandbar, it was that I had the URL-completion feature of firefox
enabled, & firefox was anticipating the rest of the url, filling it in
& making it look like a redirect. Turning that off made things much
more predictable!

Out of interest, how *do* you control where it goes after the login
form if you want to go somewhere other than where the user requested
before the login form ?

thenwithexpandedwingshesteershisflight

unread,
Apr 14, 2011, 3:39:32 AM4/14/11
to Sandbar Library
So much for that theory! It was actually something else. solved now.

Brenton

unread,
Apr 14, 2011, 3:57:01 PM4/14/11
to Sandbar Library
> Out of interest, how *do* you control where it goes after the login
> form if you want to go somewhere other than where the user requested
> before the login form ?

You can't do that at this point. You can set a default page where you
will be redirected if you have not first tried to visit a secure page.
You do this by setting the :login-page key in your adapter.

See

https://github.com/brentonashworth/sandbar/blob/0.3.3/src/sandbar/form_authentication.clj#L67

for more information.

It may not be too hard to code this yourself.

Brenton

On Apr 13, 9:46 pm, thenwithexpandedwingshesteershisflight
Reply all
Reply to author
Forward
0 new messages