Tokens small fixes
This commit is contained in:
+1
-1
Submodule grafana updated: d3cc6e518d...aaa717aac2
@@ -25,6 +25,8 @@ func Register(r *macaron.Macaron) {
|
|||||||
// authed views
|
// authed views
|
||||||
r.Get("/account/", reqSignedIn, Index)
|
r.Get("/account/", reqSignedIn, Index)
|
||||||
r.Get("/account/datasources/", reqSignedIn, Index)
|
r.Get("/account/datasources/", reqSignedIn, Index)
|
||||||
|
r.Get("/account/collaborators/", reqSignedIn, Index)
|
||||||
|
r.Get("/account/apikeys/", reqSignedIn, Index)
|
||||||
r.Get("/admin", reqSignedIn, Index)
|
r.Get("/admin", reqSignedIn, Index)
|
||||||
r.Get("/dashboard/*", reqSignedIn, Index)
|
r.Get("/dashboard/*", reqSignedIn, Index)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func GetTokens(c *middleware.Context) {
|
func GetTokens(c *middleware.Context) {
|
||||||
query := m.GetTokensQuery{AccountId: c.Account.Id}
|
query := m.GetTokensQuery{AccountId: c.UserAccount.Id}
|
||||||
err := bus.Dispatch(&query)
|
err := bus.Dispatch(&query)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -47,7 +47,7 @@ func AddToken(c *middleware.Context, cmd m.AddTokenCommand) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.AccountId = c.Account.Id
|
cmd.AccountId = c.UserAccount.Id
|
||||||
cmd.Token = util.GetRandomString(64)
|
cmd.Token = util.GetRandomString(64)
|
||||||
|
|
||||||
if err := bus.Dispatch(&cmd); err != nil {
|
if err := bus.Dispatch(&cmd); err != nil {
|
||||||
@@ -71,7 +71,7 @@ func UpdateToken(c *middleware.Context, cmd m.UpdateTokenCommand) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.AccountId = c.Account.Id
|
cmd.AccountId = c.UserAccount.Id
|
||||||
|
|
||||||
err := bus.Dispatch(&cmd)
|
err := bus.Dispatch(&cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Typed errors
|
// Typed errors
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrAccountNotFound = errors.New("Account not found")
|
ErrAccountNotFound = errors.New("Account not found")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user