Wrapping some authentication logic in sessions and registration controllers