Skip to content

Commit

Permalink
fix: handle user_code collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Jan 8, 2025
1 parent bfe986e commit 7970287
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions persistence/sql/persister_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ func (p *Persister) createDeviceAuthSession(ctx context.Context, deviceCodeSigna

if err = sqlcon.HandleError(p.CreateWithNetwork(ctx, req)); errors.Is(err, sqlcon.ErrConcurrentUpdate) {
return errors.Wrap(fosite.ErrSerializationFailure, err.Error())
} else if errors.Is(err, sqlcon.ErrUniqueViolation) {
return errors.Wrap(fosite.ErrExistingUserCodeSignature, err.Error())
} else if err != nil {
return err
}
Expand Down

0 comments on commit 7970287

Please sign in to comment.