This repository was archived by the owner on May 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 42
42
Github struct {
43
43
GithubClientID string `split_words:"true"`
44
44
GithubClientSecret string `split_words:"true"`
45
- GithubScopes []string `split_words:"true" default:"repo"`
45
+ GithubScopes []string `split_words:"true" default:"repo,read:user,read:org "`
46
46
}
47
47
48
48
Slack struct {
Original file line number Diff line number Diff line change @@ -148,13 +148,21 @@ func (w *Web) Signin(c *gin.Context) {
148
148
return
149
149
}
150
150
151
- u , _ = w .i .CreateUser (ctx , u )
151
+ if u , err = w .i .CreateUser (ctx , u ); err != nil {
152
+ w .log .Error ("It has failed to save a new user." , zap .Error (err ))
153
+ c .String (http .StatusInternalServerError , "It has failed to save a new user." )
154
+ return
155
+ }
152
156
} else if err != nil {
153
- w .log .Error ("It failed to save the user." , zap .Error (err ))
154
- c .String (http .StatusInternalServerError , "It has failed to save the user." )
157
+ w .log .Error ("It failed to find the user." , zap .Error (err ))
158
+ c .String (http .StatusInternalServerError , "It has failed to find the user." )
155
159
return
156
160
} else {
157
- u , _ = w .i .UpdateUser (ctx , u )
161
+ if u , _ = w .i .UpdateUser (ctx , u ); err != nil {
162
+ w .log .Error ("It has failed to update the user." , zap .Error (err ))
163
+ c .String (http .StatusInternalServerError , "It has failed to update the user." )
164
+ return
165
+ }
158
166
}
159
167
160
168
// Register cookie.
You can’t perform that action at this time.
0 commit comments