Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
add delete Session
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 11, 2012
1 parent 6a6c46e commit 911ce28
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/ServiceStack.ServiceInterface/Auth/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,29 @@ public override object OnGet(Auth request)
return this.Redirect(session.ReferrerUrl.AddHashParam("s", "0"));
}

public override object OnPost(Auth request)
{
if (ValidateFn != null)
{
var response = ValidateFn(this, HttpMethods.Get, request);
if (response != null) return response;
}

return CredentialsAuth(request);
}
public override object OnPost(Auth request)
{
if (ValidateFn != null)
{
var response = ValidateFn(this, HttpMethods.Post, request);
if (response != null) return response;
}

return CredentialsAuth(request);
}

public override object OnDelete(Auth request)
{
if (ValidateFn != null)
{
var response = ValidateFn(this, HttpMethods.Delete, request);
if (response != null) return response;
}

this.RemoveSession();

return new AuthResponse();
}

class CredentialsAuthValidator : AbstractValidator<Auth>
{
Expand Down

0 comments on commit 911ce28

Please sign in to comment.