store the url is session.next and after login if session.next redirect there and clear the variable.
On Sep 26, 4:48 am, "david.waldrop" <david.wald...@gmail.com> wrote: > I have an application that enables users to invite others by > capturing > their email address and sending an email invite. The invite includes > a link to a specific 'community'. When the user clicks the link they > are taken to the application. If they are already registered (which > is not the case on 1st run experience) they are taken directly to the > meeting. What I have not been able to figure out is how I take the > user to the meeting when they are a brand new user and have to > register first. I studied several posts where you and others were > debating the changes to trunk and the various paths to accomplish > this > but did not see a solution. > > The goal is the following: > 1) user clicks link > 2) system displays login screen > 3) user selects to register > 4) system registers and logs user in > 5) system takes user to correct community > > Here is what I have in me default/index controller now: > > def index(): > if not auth.is_logged_in(): > # if user clicked email link, redirect to login and set url > to > get and check meeting password > #meetingparm = request.env.http_host.split('.')[1] > #meeting = db(db.meeting.link==meetingparm).select().first() > meeting = db(db.meeting.link).select().first() > if meeting: # user clicked a link with a valid meeting, > lets get'em logged in and figure out who they are > next = > URL(r=request,c='meetings',f='getmeetingpassword',args=meeting.id) > auth.settings.register_onaccept=lambda form: > redirect(next) > auth.settings.register_next = next > redirect(URL(r=request,f='user',args='login',vars=dict(_next=next))) > return dict(message=T('')) > > The problem is I do not see how to ask web2Py to redirect to > "next' (see code above) if they have to register first and are auto- > logged in.