Skip to content

Commit 50b5aa9

Browse files
Add error description to output (#452)
* add error description to output * add empty check for err description * Update internal/pkg/auth/user_login.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com>
1 parent a645d6d commit 50b5aa9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/pkg/auth/user_login.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ func AuthorizeUser(p *print.Printer, isReauthentication bool) error {
135135

136136
// Get the authorization code
137137
code := r.URL.Query().Get("code")
138+
errDescription := r.URL.Query().Get("error_description")
138139
if code == "" {
139140
errServer = fmt.Errorf("could not find 'code' URL parameter")
141+
if errDescription != "" {
142+
errServer = fmt.Errorf("%w: %s", errServer, errDescription)
143+
}
140144
return
141145
}
142146

0 commit comments

Comments
 (0)