diff --git a/pkg/stores/sqlstore/accounts.go b/pkg/stores/sqlstore/accounts.go index 827629a36f6..07a85fdaef6 100644 --- a/pkg/stores/sqlstore/accounts.go +++ b/pkg/stores/sqlstore/accounts.go @@ -114,7 +114,10 @@ func GetAccountByToken(query *m.GetAccountByTokenQuery) error { var err error var account m.Account - has, err := x.Where("token=?", query.Token).Get(&account) + sess := x.Join("INNER", "token", "token.account_id = account.id") + sess.Omit("token.id", "token.account_id", "token.name", "token.token", + "token.role", "token.updated", "token.created") + has, err := sess.Where("token.token=?", query.Token).Get(&account) if err != nil { return err