On Mon, Jul 2, 2012 at 1:03 AM, Anthony <
abas...@gmail.com> wrote:
> Here's what the book says:
> These must point to the URL you want to redirect your users to after the
> various possible auth actions (in case there is no referrer):
>
> Notice the highlighted text. The _next URLs are default redirect URLs when
> there is no referring page, and auth.settings.register_next does in fact
> work when there is no referring page (i.e., when there is no _next var in
> the URL).
I searched the book (free PDF) for "referrer".
The term "referrer" only occurs once, where you quoted above. No
explanation given, no mention of a "_next" var in the URL.
Then I searched for "referer" thinking, OK, maybe the explanation I'm
looking for just has a typo, but found only an example of
request.env.http_referer... Maybe if I search for "_next" I'll find
some explanation that doesn't use 'referrer' but a similar term... the
only other use of "_next" is on page 346 (free PDF) where _next fields
are described as "the URL to redirect to after a successful
<operation> record." THAT'S WHAT I WANT, YAY! Woo! Hoo! No? Oh well.
It would be really nice if things with similar names had similar
meanings...
> The issue is not with auth.settings.register_next, but with the
> auth.navbar() helper. The navbar helper always adds the current page URL as
> the _next var in the register link, so if you use the navbar to get to the
> registration page, you will be redirected back to the page from which you
> clicked the link.
Unless of course you set auth.settings.login_next, in which case, no,
it doesn't; the automatically generated auth links use
auth.settings.login_next and not the page from which I clicked the
link.
> But I still don't see a bug with auth.settings.register_next.
I don't really care if the cause of the bug is the navbar function or
something else. Since auth.settings.register_next is a passive
variable, of course that can't BE the bug.
I'm trying to report what, as a mere user and not implementor, is an
anomalous behavior.
Setting auth.settings.login_next "does the right thing" (the
automatically generated navigation bar), setting
auth.settings.register_next does not have that same behavior. Maybe
that one is "has a bug." Of course since that one does what I
want/expect (see above), then from my point of view as a user of
web2py and not an implementor, it is auth.setting.register_next which
has the bug.
> The intended behavior is that a referrer takes
> precedence, and auth.settings.register_next is the default when there is no
> referrer -- and that's how it works. We now just need an easy way to prevent
> the navbar from automatically adding a referrer.
And to make it treat all the auth.settings' _next fields uniformly (or
document why it shouldn't).
Oh, and to document what "referrer" means in this context. I'll go add
a bug report for that when I've sent this.
Thanks,
-Doug