Add validate module that is generic and can be used in other places
Use new validation module in authentication