minor code formatting to login.go
This commit is contained in:
@@ -9,6 +9,18 @@ import (
|
|||||||
"github.com/go-viper/mapstructure/v2"
|
"github.com/go-viper/mapstructure/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// used when requesting GET /access/domains
|
||||||
|
type GetRealmsBody struct {
|
||||||
|
Data []Realm `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// stores each realm's data
|
||||||
|
type Realm struct {
|
||||||
|
Default int `json:"default"`
|
||||||
|
Realm string `json:"realm"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
}
|
||||||
|
|
||||||
func GetLoginRealms() ([]Realm, error) {
|
func GetLoginRealms() ([]Realm, error) {
|
||||||
realms := []Realm{}
|
realms := []Realm{}
|
||||||
|
|
||||||
@@ -37,18 +49,6 @@ func GetLoginRealms() ([]Realm, error) {
|
|||||||
return realms, nil
|
return realms, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// used when requesting GET /access/domains
|
|
||||||
type GetRealmsBody struct {
|
|
||||||
Data []Realm `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// stores each realm's data
|
|
||||||
type Realm struct {
|
|
||||||
Default int `json:"default"`
|
|
||||||
Realm string `json:"realm"`
|
|
||||||
Comment string `json:"comment"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func HandleGETLogin(c *gin.Context) {
|
func HandleGETLogin(c *gin.Context) {
|
||||||
realms, err := GetLoginRealms()
|
realms, err := GetLoginRealms()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user