feat: sort configured providers based on name length

This commit is contained in:
Stavros
2025-10-10 17:16:22 +03:00
parent b940d681c3
commit fc7e395e66

View File

@@ -7,6 +7,7 @@ import (
"net/http"
"net/url"
"os"
"sort"
"strings"
"time"
"tinyauth/internal/config"
@@ -157,6 +158,10 @@ func (app *BootstrapApp) Setup() error {
})
}
sort.Slice(configuredProviders, func(i, j int) bool {
return configuredProviders[i].Name < configuredProviders[j].Name
})
if authService.UserAuthConfigured() || ldapService != nil {
configuredProviders = append(configuredProviders, controller.Provider{
Name: "Username",