Skip to content

Commit

Permalink
fixup! pam/nativemodel: Include URI as info message
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Jul 2, 2024
1 parent 42ea6a3 commit 6c258ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pam/internal/adapter/nativemodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,12 @@ func (m nativeModel) isQrcodeRenderingSupported() bool {

func centerString(s string, reference string) string {
sizeDiff := len([]rune(reference)) - len(s)
var padding string
if sizeDiff > 0 {
padding = strings.Repeat(" ", sizeDiff/2)
if sizeDiff <= 0 {
return s
}

// We put padding in both sides, so that it's respected also by non-terminal UIs
padding := strings.Repeat(" ", sizeDiff/2)
return padding + s + padding
}

Expand Down

0 comments on commit 6c258ea

Please sign in to comment.