Skip to content

Commit

Permalink
chore: delete x.DerefUUID
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr committed Apr 12, 2023
1 parent 6a28c39 commit a69c7a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion continuity/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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."))
}

Expand Down
7 changes: 0 additions & 7 deletions x/pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a69c7a2

Please sign in to comment.