On 17 Nov, 11:51, "Florent Aide" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 11:45 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > > > On Monday 17 November 2008 09:16:09 drakkan wrote: > >> Hi all, > > >> I'm building an application backed using turbogears, so I have to > >> develop some api for other applications, I would like some directions > >> to modify @authorize.require in a way that it return a json response > >> instead to redirect to login page, > > >> can someone give me some directions? > > > Maybe it would work for you to make the login-page return JSON as well (if > > the > > headers of the request require it)? > > Maybe the return code should be handled by the client because if you > get redirected to the login page you have something different than > 200. Returning JSON from the login seems sensible also. > I agree with Diez: @require does not return anything per-se and should > not be modified to return something. > > Florent.
thanks for your hints, I'm jsonifing login however I would take advantage of already implented tg handler and not recheck user and pass against db table, how can I call login_hadler and intercept his response? So I can give different json responses based on login_handler output, thanks drakkan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

