forked from ory/kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: db index and duplicate credentials error (ory#3896)
* fix: don't return password cred type if empty * fix: better index for config.user_handle on identity_credentials
- Loading branch information
1 parent
529070b
commit 5f6d189
Showing
16 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ns/sql/20240425095000000000_identity_credentials_fix_user_handle_index.cockroach.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP INDEX identity_credentials_config_user_handle_idx; |
4 changes: 4 additions & 0 deletions
4
...ions/sql/20240425095000000000_identity_credentials_fix_user_handle_index.cockroach.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE INDEX identity_credentials_config_user_handle_idx | ||
ON identity_credentials ((config ->> 'user_handle')) | ||
WHERE config ->> 'user_handle' IS NOT NULL | ||
; |
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
...ns/sql/20240425095000000001_identity_credentials_fix_user_handle_index.cockroach.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE INVERTED INDEX identity_credentials_user_handle_idx | ||
ON identity_credentials (config) | ||
WHERE config ->> 'user_handle' IS NOT NULL; |
1 change: 1 addition & 0 deletions
1
...ions/sql/20240425095000000001_identity_credentials_fix_user_handle_index.cockroach.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP INDEX identity_credentials_user_handle_idx; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1285,7 +1285,7 @@ func TestStrategy(t *testing.T) { | |
var linkingLoginFlow struct{ ID string } | ||
t.Run("step=should fail login and start a new login", func(t *testing.T) { | ||
res, body := loginWithOIDC(t, client, loginFlow.ID, "valid") | ||
assertUIError(t, res, body, "You tried signing in with [email protected] which is already in use by another account. You can sign in using social sign in, or your password. You can sign in using one of the following social sign in providers: Secondprovider.") | ||
assertUIError(t, res, body, "You tried signing in with [email protected] which is already in use by another account. You can sign in using social sign in. You can sign in using one of the following social sign in providers: Secondprovider.") | ||
linkingLoginFlow.ID = gjson.GetBytes(body, "id").String() | ||
assert.NotEqual(t, loginFlow.ID.String(), linkingLoginFlow.ID, "should have started a new flow") | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters