From 70f6ad9988a208b1ee57cd053af1c7ea6506bd40 Mon Sep 17 00:00:00 2001 From: Bastian Date: Wed, 3 May 2023 13:54:00 +0200 Subject: [PATCH] fix(client): correct serverinfo endpoint (#382) --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 82db51b..2bc75fe 100644 --- a/client.go +++ b/client.go @@ -288,13 +288,13 @@ func SetCertCacheInvalidationTime(duration time.Duration) func(g *GoCloak) { } // GetServerInfo fetches the server info. -func (g *GoCloak) GetServerInfo(ctx context.Context, accessToken string) ([]*ServerInfoRepresentation, error) { +func (g *GoCloak) GetServerInfo(ctx context.Context, accessToken string) (*ServerInfoRepresentation, error) { errMessage := "could not get server info" - var result []*ServerInfoRepresentation + var result *ServerInfoRepresentation resp, err := g.GetRequestWithBearerAuth(ctx, accessToken). SetResult(&result). - Get(makeURL(g.basePath, "admin", "realms")) + Get(makeURL(g.basePath, "admin", "serverinfo")) if err := checkForError(resp, err, errMessage); err != nil { return nil, err