> > The identity framework redirects to the login page if the user is not
> > authorized to view the requested resource. Is it possible to customize
> > this behaviour? More specifically, for some of my controller methods
> > this behaviour is just fine but for some others -- those that only
> > return json and never html -- I would like to see a default json data
> > for instance { 'error': 'Not authorized' } be returned instead of the
> > redirect. Can this be done in a simple way?
>
> The login page is actually a controller (you can also change it with
> identity.failure_url), so you should be able to check there whether
> tg_format=json and then behave differently.

Thanks a lot!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to