Commit ced5e550 by Torkel Ödegaard

mini code cleanup of in auth

parent 7b17e38f
...@@ -47,14 +47,13 @@ func authByToken(c *Context) { ...@@ -47,14 +47,13 @@ func authByToken(c *Context) {
} }
token := parts[1] token := parts[1]
userQuery := m.GetAccountByTokenQuery{Token: token} userQuery := m.GetAccountByTokenQuery{Token: token}
err := bus.Dispatch(&userQuery)
if err != nil { if err := bus.Dispatch(&userQuery); err != nil {
return return
} }
usingQuery := m.GetAccountByIdQuery{Id: userQuery.Result.UsingAccountId} usingQuery := m.GetAccountByIdQuery{Id: userQuery.Result.UsingAccountId}
err = bus.Dispatch(&usingQuery) if err := bus.Dispatch(&usingQuery); err != nil {
if err != nil {
return return
} }
...@@ -71,15 +70,13 @@ func authBySession(c *Context, sess session.Store) { ...@@ -71,15 +70,13 @@ func authBySession(c *Context, sess session.Store) {
} }
userQuery := m.GetAccountByIdQuery{Id: accountId} userQuery := m.GetAccountByIdQuery{Id: accountId}
err = bus.Dispatch(&userQuery) if err := bus.Dispatch(&userQuery); err != nil {
if err != nil {
authDenied(c) authDenied(c)
return return
} }
usingQuery := m.GetAccountByIdQuery{Id: userQuery.Result.UsingAccountId} usingQuery := m.GetAccountByIdQuery{Id: userQuery.Result.UsingAccountId}
err = bus.Dispatch(&usingQuery) if err := bus.Dispatch(&usingQuery); err != nil {
if err != nil {
authDenied(c) authDenied(c)
return return
} }
......
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