Ford: validate auth code

This commit is contained in:
andig 2022-07-04 18:24:00 +02:00
parent 398ddd6584
commit 8dfe3417a8

View file

@ -126,6 +126,10 @@ func (v *Identity) login() (*oauth.Token, error) {
defer cancel()
code := loc.Query().Get("code")
if code == "" {
return nil, errors.New("could not obtain auth code- check user and password")
}
tok, err := OAuth2Config.Exchange(ctx, code,
oauth2.SetAuthURLParam("grant_type", "authorization_code"),
oauth2.SetAuthURLParam("code_verifier", cv.CodeChallengePlain()),