🎨 oauth2 update

This commit is contained in:
landaiqing
2024-08-21 22:00:47 +08:00
parent 58ca15768b
commit 78346f6a12
6 changed files with 142 additions and 23 deletions

View File

@@ -176,7 +176,7 @@ func (OAuthAPI) Callback(c *gin.Context) {
}
Id := strconv.Itoa(gitHubUser.ID)
userSocial, err := userSocialService.QueryUserSocialByUUID(Id, enum.OAuthSourceGithub)
if errors.Is(err, gorm.ErrRecordNotFound) {
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
// 第一次登录,创建用户
uid := idgen.NextId()
uidStr := strconv.FormatInt(uid, 10)