Skip to content

Commit

Permalink
Merge pull request #51 from GESkunkworks/feature/ping-error-messages
Browse files Browse the repository at this point in the history
pass ping error messages through to user
  • Loading branch information
Squwid authored Oct 27, 2020
2 parents 34cac26 + 1940007 commit ff6fef2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/provider/pingfed/pingfed.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ func (ac *Client) handleLogin(ctx context.Context, doc *goquery.Document) (conte
return ctx, nil, fmt.Errorf("no context value for 'login'")
}

// Check for errors from Ping
pingErrors := doc.Find("form>.ping-messages>.ping-error")
if pingErrors.Size() == 1 {
return ctx, nil, errors.New(pingErrors.Text())
}

if loginAttempt > 1 {
// Password was not accepted. Re-prompt for login details
log.Println("Invalid username or password")
Expand Down

0 comments on commit ff6fef2

Please sign in to comment.