ServiceStack/ServiceStack — pull request #918 by iamruss (2014-05-16 07:48:11+00:00)
Title: Extended AuthDto with Info parameter so clients can query Session status

I propose this change to allow clients like Single Page Application to query session status by making requests like `http://localhost:38866/auth.json?info=CurrentSession`

For example, in my angularjs SPA application I have controller which swaps "sign in|sign out" links in header menu. Since this is SPA and I it requests it's data in small chunks and present received data with appropriate templates.

I could use $watch and listen to changes in my utmUserAuth service (a service as in angular domain) and set/reset session on login/logout by using the session information returned, but then I have to figure out how to handle oAuth logins, which just redirect to "success" url without providing explicit session details.

To workaround this, I had to create new DTO (thus minus one useful DTO on my "free-loader-license" :smile: ) VerifyAuth and assigned it to route "/auth/verify".

The snippet bellow shows my workaround (commented out) and the use of the proposed change.

https://gist.github.com/iamruss/48d9ee4ed8ef03726a7a#file-controller-js

and here is an animated screencapture of the result in action:
![header](https://cloud.githubusercontent.com/assets/204439/2994489/2601c6ea-dcce-11e3-920e-d75feb048e44.gif)

Kind regards,
Rouslan Grabar