public void SetAuthorizationAsInvalid(Guid authCode) { var auth = AuthorizationLog.FindByAuthCode(authCode + ""); if (auth != null) { auth.IsValid = false; auth.Save(); } }
public void UpdateAuthorization(Guid authCode, DateTime expires, String lastIp) { var auth = AuthorizationLog.FindByAuthCode(authCode + ""); if (auth != null) { auth.Expires = expires; auth.LastIp = lastIp; auth.Save(); } }
public Token GetToken(Guid authCode) { var auth = AuthorizationLog.FindByAuthCode(authCode + ""); if (auth == null) { return(null); } var user = auth.User; return(new Token(auth.AuthCode, auth.UserID, user.Name, user.NickName, user.IsAdmin, auth.Expires) { LastIp = auth.LastIp }); }