Commit ed879df1 by Torkel Ödegaard

Corrected spelling of SignedInUser (was SignInUser)

parent 2b05dac0
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
type Context struct { type Context struct {
*macaron.Context *macaron.Context
*m.SignInUser *m.SignedInUser
Session session.Store Session session.Store
...@@ -37,7 +37,7 @@ func GetContextHandler() macaron.Handler { ...@@ -37,7 +37,7 @@ func GetContextHandler() macaron.Handler {
log.Error(3, "Failed to get user by id, %v, %v", accountId, err) log.Error(3, "Failed to get user by id, %v, %v", accountId, err)
} else { } else {
ctx.IsSignedIn = true ctx.IsSignedIn = true
ctx.SignInUser = query.Result ctx.SignedInUser = query.Result
} }
} else if token := getApiToken(ctx); token != "" { } else if token := getApiToken(ctx); token != "" {
// Try API Key auth // Try API Key auth
...@@ -54,12 +54,12 @@ func GetContextHandler() macaron.Handler { ...@@ -54,12 +54,12 @@ func GetContextHandler() macaron.Handler {
} }
ctx.IsSignedIn = true ctx.IsSignedIn = true
ctx.SignInUser = query.Result ctx.SignedInUser = query.Result
// api key role // api key role
ctx.SignInUser.UserRole = tokenInfo.Role ctx.UserRole = tokenInfo.Role
ctx.SignInUser.UsingAccountId = ctx.SignInUser.AccountId ctx.UsingAccountId = ctx.AccountId
ctx.SignInUser.UsingAccountName = ctx.SignInUser.UserName ctx.UsingAccountName = ctx.UserName
} }
} }
......
...@@ -87,12 +87,12 @@ type SearchAccountsQuery struct { ...@@ -87,12 +87,12 @@ type SearchAccountsQuery struct {
type GetSignedInUserQuery struct { type GetSignedInUserQuery struct {
AccountId int64 AccountId int64
Result *SignInUser Result *SignedInUser
} }
// ------------------------ // ------------------------
// DTO & Projections // DTO & Projections
type SignInUser struct { type SignedInUser struct {
AccountId int64 AccountId int64
UsingAccountId int64 UsingAccountId int64
UsingAccountName string UsingAccountName string
......
...@@ -174,7 +174,7 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error { ...@@ -174,7 +174,7 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error {
LEFT OUTER JOIN collaborator on collaborator.account_id = usingAccount.id AND collaborator.collaborator_id = userAccount.id LEFT OUTER JOIN collaborator on collaborator.account_id = usingAccount.id AND collaborator.collaborator_id = userAccount.id
WHERE userAccount.id=?` WHERE userAccount.id=?`
var user m.SignInUser var user m.SignedInUser
sess := x.Table("account") sess := x.Table("account")
has, err := sess.Sql(rawSql, query.AccountId).Get(&user) has, err := sess.Sql(rawSql, query.AccountId).Get(&user)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment