mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
feat(be): sort oauth providers
This commit is contained in:
parent
678260970f
commit
123135dd9d
@ -10,6 +10,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -212,6 +213,7 @@ func login(w http.ResponseWriter, r *http.Request) {
|
||||
LoginWithPassword: !util.Config.PasswordLoginDisable,
|
||||
}
|
||||
i := 0
|
||||
|
||||
for k, v := range util.Config.OidcProviders {
|
||||
config.OidcProviders[i] = loginMetadataOidcProvider{
|
||||
ID: k,
|
||||
@ -221,6 +223,13 @@ func login(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
sort.Slice(config.OidcProviders, func(i, j int) bool {
|
||||
a := util.Config.OidcProviders[config.OidcProviders[i].ID]
|
||||
b := util.Config.OidcProviders[config.OidcProviders[j].ID]
|
||||
return a.Order < b.Order
|
||||
})
|
||||
|
||||
helpers.WriteJSON(w, http.StatusOK, config)
|
||||
return
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ type OidcProvider struct {
|
||||
NameClaim string `json:"name_claim" default:"preferred_username"`
|
||||
EmailClaim string `json:"email_claim" default:"email"`
|
||||
EmailSuffix string `json:"email_suffix"`
|
||||
Order int `json:"order"`
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -773,6 +773,9 @@ export default {
|
||||
},
|
||||
|
||||
project() {
|
||||
if (this.projects == null) {
|
||||
return null;
|
||||
}
|
||||
return this.projects.find((x) => x.id === this.projectId);
|
||||
},
|
||||
|
||||
|
@ -77,8 +77,18 @@
|
||||
ref="signInForm"
|
||||
lazy-validation
|
||||
v-model="signInFormValid"
|
||||
style="width: 300px; height: 300px;"
|
||||
style="width: 300px;"
|
||||
>
|
||||
|
||||
<v-img
|
||||
width="80"
|
||||
height="80"
|
||||
transition="0"
|
||||
src="favicon.png"
|
||||
style="margin: auto;"
|
||||
class="mb-4"
|
||||
/>
|
||||
|
||||
<h3 class="text-center mb-8">{{ $t('semaphore') }}</h3>
|
||||
|
||||
<v-alert
|
||||
|
Loading…
Reference in New Issue
Block a user