Trigger meaningful error when VW consent screen is observed (#478)

This commit is contained in:
andig 2020-11-25 18:04:24 +01:00 • committed by GitHub
parent 8ce04e5aa8
commit 845422faf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,10 @@ type Identity struct {
func (v *Identity) redirect(resp *http.Response, err error) (*http.Response, error) {
if err == nil {
uri := resp.Header.Get("Location")
if uri == "" {
return nil, errors.New("could not find expected HTTP redirect header\ngo to https://www.portal.volkswagen-we.com/ check account status")
}
resp, err = v.Get(uri)
}