Skip to content

Commit

Permalink
fix(lookup): resolve reuse scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 19, 2021
1 parent 8c4d8a2 commit dbfe475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion selfservice/strategy/lookup/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func (c *CredentialsConfig) ToNode() *node.Node {
}
}

return node.NewTextField(node.LookupCodes, text.NewInfoSelfServiceSettingsLookupSecretList(formatted, messages), node.LookupGroup).WithMetaLabel(text.NewInfoSelfServiceSettingsLookupSecretsLabel())
return node.NewTextField(node.LookupCodes, text.NewInfoSelfServiceSettingsLookupSecretList(formatted, messages), node.LookupGroup).
WithMetaLabel(text.NewInfoSelfServiceSettingsLookupSecretsLabel())
}

type RecoveryCode struct {
Expand Down
5 changes: 4 additions & 1 deletion selfservice/strategy/lookup/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package lookup

import (
"encoding/json"
"github.com/ory/x/sqlcon"
"net/http"
"time"

Expand Down Expand Up @@ -105,8 +106,10 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
}

i, c, err := s.d.PrivilegedIdentityPool().FindByCredentialsIdentifier(r.Context(), s.ID(), ss.IdentityID.String())
if err != nil {
if errors.Is(err, sqlcon.ErrNoRows) {
return nil, s.handleLoginError(r, f, errors.WithStack(schema.NewNoLookupDefined()))
} else if err != nil {
return nil, s.handleLoginError(r, f, err)
}

var o CredentialsConfig
Expand Down

0 comments on commit dbfe475

Please sign in to comment.