Getting account details using middleware