Added function to prune expired authorization codes
Added exceptions for the authorization code