Permalink
Browse files

add delete Session

  • Loading branch information...
1 parent 6a6c46e commit 911ce28186ddb43ea70b55ed5fa56a4dff1e5735 @mythz mythz committed Jan 11, 2012
Showing with 23 additions and 10 deletions.
  1. +23 −10 src/ServiceStack.ServiceInterface/Auth/AuthService.cs
@@ -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>
{

0 comments on commit 911ce28

Please sign in to comment.