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 4242 Github struct {
4343 GithubClientID string `split_words:"true"`
4444 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 "`
4646 }
4747
4848 Slack struct {
Original file line number Diff line number Diff line change @@ -148,13 +148,21 @@ func (w *Web) Signin(c *gin.Context) {
148148 return
149149 }
150150
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+ }
152156 } 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." )
155159 return
156160 } 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+ }
158166 }
159167
160168 // Register cookie.
You can’t perform that action at this time.
0 commit comments