Skip to content

Commit 394def7

Browse files
author
Nils L. Hillmann
committed
Removed unneeded if statement
1 parent d255628 commit 394def7

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

routers/user/oauth.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,19 @@ func InfoOAuth(ctx *context.Context) {
236236
})
237237
return
238238
}
239-
if uid != 0 {
240-
authUser, err := models.GetUserByID(uid)
241-
if err != nil {
242-
ctx.ServerError("GetUserByID", err)
243-
return
244-
}
245-
response := &userInfoResponse{
246-
Sub: fmt.Sprint(authUser.ID),
247-
Name: authUser.FullName,
248-
Username: authUser.Name,
249-
Email: authUser.Email,
250-
Picture: authUser.AvatarLink(),
251-
}
252-
ctx.JSON(http.StatusOK, response)
239+
authUser, err := models.GetUserByID(uid)
240+
if err != nil {
241+
ctx.ServerError("GetUserByID", err)
242+
return
243+
}
244+
response := &userInfoResponse{
245+
Sub: fmt.Sprint(authUser.ID),
246+
Name: authUser.FullName,
247+
Username: authUser.Name,
248+
Email: authUser.Email,
249+
Picture: authUser.AvatarLink(),
253250
}
251+
ctx.JSON(http.StatusOK, response)
254252
}
255253

256254
// AuthorizeOAuth manages authorize requests

0 commit comments

Comments
 (0)