Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CAPILoginFilter : ActionFilterAttribute
- {
- public override void OnActionExecuting(HttpActionContext i_actionContext)
- {
- CRequestBase request = (CRequestBase)i_actionContext.ActionArguments["i_request"];
- CCAccount account = CAPILogin.AccountIDGetOBJ(request.UserName, request.Password);
- if(account == null)
- {
- throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized));
- }
- else
- {
- //return account object to calling method here
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement