aboutsummaryrefslogtreecommitdiff
path: root/api/user.go
diff options
context:
space:
mode:
authorjloup <jloup@jloup.work>2018-05-13 23:14:26 +0200
committerjloup <jloup@jloup.work>2018-05-13 23:18:48 +0200
commit2e4885d98ec49203180deb7e4e9148762e4720e7 (patch)
treef018a158d2f39133a21dba899176f6fde606bd92 /api/user.go
parent6bf174a95ba0f71abf25397316fc101405381cdf (diff)
downloadFront-2e4885d98ec49203180deb7e4e9148762e4720e7.tar.gz
Front-2e4885d98ec49203180deb7e4e9148762e4720e7.tar.zst
Front-2e4885d98ec49203180deb7e4e9148762e4720e7.zip
Admin minimal dashboard.v0.0.14
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 {