merging branch changes to device auth, and added inner exception to retry logic