aboutsummaryrefslogtreecommitdiff
path: root/api/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/user.go b/api/user.go
index bc24bbb..ff539f0 100644
--- a/api/user.go
+++ b/api/user.go
@@ -62,7 +62,8 @@ type SignParams struct {
62} 62}
63 63
64type SignResult struct { 64type SignResult struct {
65 Token string `json:"token"` 65 Token string `json:"token"`
66 IsAdmin bool `json:"isAdmin"`
66} 67}
67 68
68func (s SignParams) Validate() *Error { 69func (s SignParams) Validate() *Error {
@@ -142,7 +143,7 @@ func (q SignupQuery) Run() (interface{}, *Error) {
142 } 143 }
143 } 144 }
144 145
145 return SignResult{token}, nil 146 return SignResult{token, newUser.Role == db.RoleAdmin}, nil
146} 147}
147 148
148type SigninQuery struct { 149type SigninQuery struct {
@@ -173,7 +174,7 @@ func (q SigninQuery) Run() (interface{}, *Error) {
173 return nil, NewInternalError(err) 174 return nil, NewInternalError(err)
174 } 175 }
175 176
176 return SignResult{token}, nil 177 return SignResult{token, user.Role == db.RoleAdmin}, nil
177} 178}
178 179
179type ConfirmEmailQuery struct { 180type ConfirmEmailQuery struct {