Reputation: 18178
Is there an easy way I can easily check whether I am currently logged into ServiceStack Auth by using a REST endpoint?
Upvotes: 1
Views: 46
Reputation: 21521
ServiceStack v4 has been recently updated, Friday 16 May, (in this commit) to support returning session information by making a GET
request to the Authenticate
route /auth
.
Thus if you have a valid session you will get a response such as:
{
"UserId":"1",
"SessionId":"1",
"UserName":"bob",
"ResponseStatus":{}
}
Otherwise you can always create a service that returns information about your session yourself. See my other answer for an example of this method.
Hope that helps.
Upvotes: 3