Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/apps/oauth/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func doOAuth(ctx context.Context, code string) (*User, error) {
span.SetStatus(codes.Error, err.Error())
return nil, err
}
} else if errors.Is(txByUsername.Error, gorm.ErrRecordNotFound) {
} else if errors.Is(txByID.Error, gorm.ErrRecordNotFound) {
user = User{
ID: userInfo.Id,
Username: userInfo.Username,
Expand All @@ -140,8 +140,8 @@ func doOAuth(ctx context.Context, code string) (*User, error) {
user.EnqueueBadgeScoreTask(ctx)
} else {
// query failed
span.SetStatus(codes.Error, txByUsername.Error.Error())
return nil, txByUsername.Error
span.SetStatus(codes.Error, txByID.Error.Error())
return nil, txByID.Error
}
} else {
if user.ID != userInfo.Id {
Expand Down