From a69c7a23211fe5f1d0171c833ce5a62c11a12285 Mon Sep 17 00:00:00 2001 From: Arne Luenser Date: Wed, 12 Apr 2023 15:50:07 +0200 Subject: [PATCH] chore: delete x.DerefUUID --- continuity/container.go | 3 ++- x/pointer.go | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/continuity/container.go b/continuity/container.go index 85e6e1c2124d..9b2d434b859a 100644 --- a/continuity/container.go +++ b/continuity/container.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/ory/herodot" + "github.com/ory/x/pointerx" "github.com/ory/x/sqlxx" "github.com/ory/kratos/x" @@ -61,7 +62,7 @@ func (c *Container) Valid(identity uuid.UUID) error { return errors.WithStack(herodot.ErrBadRequest.WithReasonf("You must restart the flow because the resumable session has expired.")) } - if identity != uuid.Nil && x.DerefUUID(c.IdentityID) != identity { + if identity != uuid.Nil && pointerx.Deref(c.IdentityID) != identity { return errors.WithStack(herodot.ErrBadRequest.WithReasonf("You must restart the flow because the resumable session was initiated by another person.")) } diff --git a/x/pointer.go b/x/pointer.go index 9d45a9c08d0a..e7360e853913 100644 --- a/x/pointer.go +++ b/x/pointer.go @@ -11,10 +11,3 @@ func PointToUUID(id uuid.UUID) *uuid.UUID { } return &id } - -func DerefUUID(id *uuid.UUID) uuid.UUID { - if id == nil { - return uuid.Nil - } - return *id -}