diff --git a/persistence/sql/persister_device.go b/persistence/sql/persister_device.go index 50675646b45..c6663236cb1 100644 --- a/persistence/sql/persister_device.go +++ b/persistence/sql/persister_device.go @@ -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 }