diff options
Diffstat (limited to 'app/controllers/api.go')
-rw-r--r-- | app/controllers/api.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/api.go b/app/controllers/api.go index 39fc227..0820584 100644 --- a/app/controllers/api.go +++ b/app/controllers/api.go | |||
@@ -3,9 +3,9 @@ package controllers | |||
3 | import ( | 3 | import ( |
4 | "net/http" | 4 | "net/http" |
5 | 5 | ||
6 | "code.crute.us/mcrute/cloud-identity-broker/app" | ||
6 | "code.crute.us/mcrute/cloud-identity-broker/app/middleware" | 7 | "code.crute.us/mcrute/cloud-identity-broker/app/middleware" |
7 | 8 | ||
8 | glecho "code.crute.us/mcrute/golib/echo" | ||
9 | "github.com/labstack/echo/v4" | 9 | "github.com/labstack/echo/v4" |
10 | ) | 10 | ) |
11 | 11 | ||
@@ -23,12 +23,14 @@ func APIIndexHandler(c echo.Context) error { | |||
23 | return echo.ErrUnauthorized | 23 | return echo.ErrUnauthorized |
24 | } | 24 | } |
25 | 25 | ||
26 | au := app.AppURL{} | ||
27 | |||
26 | out := map[string]string{ | 28 | out := map[string]string{ |
27 | "accounts": glecho.URLFor(c, "/api/account").String(), | 29 | "accounts": au.Account(c, "", nil), |
28 | } | 30 | } |
29 | 31 | ||
30 | if p.IsAdmin { | 32 | if p.IsAdmin { |
31 | out["users"] = glecho.URLFor(c, "/api/user").String() | 33 | out["users"] = au.User(c, nil) |
32 | } | 34 | } |
33 | 35 | ||
34 | return c.JSON(http.StatusOK, out) | 36 | return c.JSON(http.StatusOK, out) |