Hi!
As I understand *requires() * designed to decorate and *back* redirection
after login, so it ignores *auth.settings.login_next *
If you want to redirect after login just do it from your *check_condition()*
directly
On Thursday, May 26, 2016 at 5:15:15 PM UTC+3, 黄祥 wrote:
>
>
follow the instruction is working well, thank you, but when i tried to add
the condition it didn't work.
e.g.
*controllers/default.py*
*"""*
*not work because of this*
*def check_condition(): *
*auth.settings.login_next = URL('user/profile')*
*if request.function != 'user':*
*
Is this still the recommended way to send logged in users to a particular
page?
I was looking for how to send my logged in users to a particular page, and
eventually found this thread after a fair bit of time searching.
So I'm just echoing a desire to see this (I suspect) very common case
PS
... Glad to find this though at least, and thank you to everyone involved
in the thread!
I am a beginning user, and I'm starting at the beginning of my app's most
fundamental needs (in this case of course, logging in, and what a user will
see when they do so)
On Thursday, December 6,
Peter, I agree with you 100% regarding the ambiguous documentation, and the
lost time back and forth, among google searches and source code reading...
I am one of them!
Kostas
'These must point to the URL you want to redirect your users to after the
various possible auth actions (in
Rob, the the 'referrer_actions=None' as a navbar means that the login_next
is followed. So the 'auth.next=None' is no longer needed.
So the instructions should be
# - - - - - - - - - - - - - - - - - -
# RAM START -
# Instructions: Copy all of this into your db.py, and make the one change
in
Hey thanks Peter.
I changed it, tested it, all is 100%.
Rob
--
Sorry, I didn't look closely at your code. You said you added
auth.navbar(referrer_actions=None) to your db.py file, but that's not where
it goes. auth.navbar() is a helper that generates HTML, so it goes in a
view. By default, it is included in layout.html, and if you actually have
the navbar
Anthony:
Thanks... I appreciate everyone's help on this thread. I did what you
suggested.
and I now have it working (perfectly- I think)
. I added 2 lines to db.py
and inserted into layout.html
referrer_actions=None
as shown in detail below.
I also learned how to redirect a user, after
Thanks !
I spend some more time wrestling with this, and expanding my knowledge of
this feature of web2py, which I enjoy doing.
*GOOD NEWS*, I finally got it to work, on a simple web2py app. - just by
adding 2 lines in the right place.
(copy of working code below)
Now, I'm not sure if a bug
How does someone arrive at your login page? Is it via the Login link
generated by the auth.navbar()?
Anthony
On Friday, November 16, 2012 10:42:48 AM UTC-5, Rob_McC wrote:
Thanks !
I spend some more time wrestling with this, and expanding my knowledge of
this feature of web2py, which I
I have already issued a bug report. for
auth.navbar(referrer_actions=None)
Peter
On Friday, 16 November 2012 18:03:12 UTC, Anthony wrote:
How does someone arrive at your login page? Is it via the Login link
generated by the auth.navbar()?
Anthony
On Friday, November 16, 2012 10:42:48 AM
Hey Anthony:
Q
How does someone arrive at your login page? Is it via the Login link
generated by the auth.navbar()?
A:
I have tested a few ways... here are my findings
*Method 1*
- From home page,
http://127.0.0.1:8000/AuthRedirect/default/user/login?_next=/AuthRedirect/default/index
Instead, perhaps we can just improve the documentation.
Yes, it would be great if the documentation were changed to something like
your explanation below, but clearer on the navbar bit. I believe you
concluded back in July that the documentation could be clearer.
you just have to set the
auth.navbar(referrer_actions=None)
did not work for Rob or for myself.
If that's the case, then please submit an issue in Google
Codehttp://code.google.com/p/web2py/issues/list,
as that would be a bug.
Thanks.
Anthony
--
You are not the only person to have wasted a lot of time on this issue.
There iso many issues that the Web2py team are excellent on, but this is
not one of them.
'auth.navbar(referrer_actions=None)'
Also did not work for me with 2.2.1
however putting
'auth.next = None' did work.
In the
If setting auth.user.settings to a URL stopped the bit of code that
generates _next when default/user/register is 'called' then it would seem
to fit in with developers expectations.
Keep in mind, currently it is possible to enable referrers (i.e., the _next
parameter in the URLs) while
17 matches
Mail list logo