Skip to content

Commit

Permalink
autogen: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Aug 29, 2023
1 parent 16b6021 commit b81e81d
Show file tree
Hide file tree
Showing 22 changed files with 61 additions and 45 deletions.
6 changes: 4 additions & 2 deletions identity/.snapshots/TestToNode.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"text": "Secret was used at 2021-08-17 11:32:38 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:38Z"
"used_at": "2021-08-17T11:32:38Z",
"used_at_unix": 1629199958
}
},
{
Expand All @@ -37,7 +38,8 @@
"text": "Secret was used at 2021-08-17 11:32:48 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:48Z"
"used_at": "2021-08-17T11:32:48Z",
"used_at_unix": 1629199968
}
}
]
Expand Down
8 changes: 0 additions & 8 deletions schema/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ package schema
import (
"fmt"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/pkg/errors"

"github.com/ory/jsonschema/v3"
Expand Down Expand Up @@ -145,11 +142,6 @@ type DuplicateCredentialsHinter interface {

func NewDuplicateCredentialsError(err error) error {
if hinter := DuplicateCredentialsHinter(nil); errors.As(err, &hinter) && hinter.HasHints() {
oidcProviders := make([]string, 0, len(hinter.AvailableOIDCProviders()))
for _, provider := range hinter.AvailableOIDCProviders() {
oidcProviders = append(oidcProviders, cases.Title(language.English).String(provider))
}

return errors.WithStack(&ValidationError{
ValidationError: &jsonschema.ValidationError{
Message: `an account with the same identifier (email, phone, username, ...) exists already`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
"id": 4000001,
"text": "The active recovery strategy code is not enabled. Please enable it in the configuration.",
"type": "error",
"context": {}
"context": {
"reason": "The active recovery strategy code is not enabled. Please enable it in the configuration."
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
"id": 4000001,
"text": "The active recovery strategy code is not enabled. Please enable it in the configuration.",
"type": "error",
"context": {}
"context": {
"reason": "The active recovery strategy code is not enabled. Please enable it in the configuration."
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1010007,
"text": "Backup recovery code",
"type": "info"
Expand All @@ -45,7 +44,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1010010,
"text": "Use backup recovery code",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"text": "Secret was used at 2021-08-17 11:32:39 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:39Z"
"used_at": "2021-08-17T11:32:39Z",
"used_at_unix": 1629199959
}
},
{
Expand All @@ -59,7 +60,8 @@
"text": "Secret was used at 2021-08-17 11:32:42 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:42Z"
"used_at": "2021-08-17T11:32:42Z",
"used_at_unix": 1629199962
}
},
{
Expand All @@ -83,7 +85,8 @@
"text": "Secret was used at 2021-08-17 11:32:45 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:45Z"
"used_at": "2021-08-17T11:32:45Z",
"used_at_unix": 1629199965
}
},
{
Expand All @@ -107,7 +110,8 @@
"text": "Secret was used at 2021-08-17 11:32:48 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:48Z"
"used_at": "2021-08-17T11:32:48Z",
"used_at_unix": 1629199968
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"text": "Secret was used at 2021-08-17 11:32:39 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:39Z"
"used_at": "2021-08-17T11:32:39Z",
"used_at_unix": 1629199959
}
},
{
Expand All @@ -59,7 +60,8 @@
"text": "Secret was used at 2021-08-17 11:32:42 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:42Z"
"used_at": "2021-08-17T11:32:42Z",
"used_at_unix": 1629199962
}
},
{
Expand All @@ -83,7 +85,8 @@
"text": "Secret was used at 2021-08-17 11:32:45 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:45Z"
"used_at": "2021-08-17T11:32:45Z",
"used_at_unix": 1629199965
}
},
{
Expand All @@ -107,7 +110,8 @@
"text": "Secret was used at 2021-08-17 11:32:48 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:48Z"
"used_at": "2021-08-17T11:32:48Z",
"used_at_unix": 1629199968
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"text": "Secret was used at 2021-08-17 11:32:39 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:39Z"
"used_at": "2021-08-17T11:32:39Z",
"used_at_unix": 1629199959
}
},
{
Expand All @@ -59,7 +60,8 @@
"text": "Secret was used at 2021-08-17 11:32:42 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:42Z"
"used_at": "2021-08-17T11:32:42Z",
"used_at_unix": 1629199962
}
},
{
Expand All @@ -83,7 +85,8 @@
"text": "Secret was used at 2021-08-17 11:32:45 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:45Z"
"used_at": "2021-08-17T11:32:45Z",
"used_at_unix": 1629199965
}
},
{
Expand All @@ -107,7 +110,8 @@
"text": "Secret was used at 2021-08-17 11:32:48 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:48Z"
"used_at": "2021-08-17T11:32:48Z",
"used_at_unix": 1629199968
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"text": "Secret was used at 2021-08-17 11:32:39 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:39Z"
"used_at": "2021-08-17T11:32:39Z",
"used_at_unix": 1629199959
}
},
{
Expand All @@ -59,7 +60,8 @@
"text": "Secret was used at 2021-08-17 11:32:42 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:42Z"
"used_at": "2021-08-17T11:32:42Z",
"used_at_unix": 1629199962
}
},
{
Expand All @@ -83,7 +85,8 @@
"text": "Secret was used at 2021-08-17 11:32:45 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:45Z"
"used_at": "2021-08-17T11:32:45Z",
"used_at_unix": 1629199965
}
},
{
Expand All @@ -107,7 +110,8 @@
"text": "Secret was used at 2021-08-17 11:32:48 +0000 UTC",
"type": "info",
"context": {
"used_at": "2021-08-17T11:32:48Z"
"used_at": "2021-08-17T11:32:48Z",
"used_at_unix": 1629199968
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1010006,
"text": "Authentication code",
"type": "info"
Expand All @@ -45,7 +44,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1010009,
"text": "Use Authenticator",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"id": 4000008,
"text": "The provided authentication code is invalid, please try again.",
"type": "error",
"context": {}
"type": "error"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
"messages": [
{
"text": "Prepare your WebAuthn device (e.g. security key, biometrics scanner, ...) and press continue.",
"type": "info",
"context": {}
"type": "info"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
"messages": [
{
"text": "Prepare your WebAuthn device (e.g. security key, biometrics scanner, ...) and press continue.",
"type": "info",
"context": {}
"type": "info"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1010001,
"text": "Sign in with security key",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"label": {
"context": {
"added_at": "0001-01-01T00:00:00Z",
"added_at_unix": -62135596800,
"display_name": "bar"
},
"id": 1050018,
Expand All @@ -49,6 +50,7 @@
"label": {
"context": {
"added_at": "0001-01-01T00:00:00Z",
"added_at_unix": -62135596800,
"display_name": "foo"
},
"id": 1050018,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"id": 4000001,
"text": "unable to remove this security key because it would lock you out of your account",
"type": "error",
"context": {}
"context": {
"reason": "unable to remove this security key because it would lock you out of your account"
}
}
],
"meta": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"id": 4000001,
"text": "unable to remove this security key because it would lock you out of your account",
"type": "error",
"context": {}
"context": {
"reason": "unable to remove this security key because it would lock you out of your account"
}
}
],
"meta": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1040001,
"text": "Sign up",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1040001,
"text": "Sign up",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1040001,
"text": "Sign up",
"type": "info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"messages": [],
"meta": {
"label": {
"context": {},
"id": 1040001,
"text": "Sign up",
"type": "info"
Expand Down
8 changes: 8 additions & 0 deletions text/message_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"fmt"
"strings"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"golang.org/x/exp/maps"
)

Expand Down Expand Up @@ -269,6 +272,11 @@ func NewErrorValidationDuplicateCredentialsWithHints(availableCredentialTypes []
if identifier == "" {
identifier = "an email, phone, or username"
}
oidcProviders := make([]string, 0, len(availableOIDCProviders))
for _, provider := range availableOIDCProviders {
oidcProviders = append(oidcProviders, cases.Title(language.English).String(provider))
}

reason := fmt.Sprintf("You tried signing in with %s which is already in use by another account.", identifier)
if len(availableCredentialTypes) > 0 {
humanReadable := make(map[string]struct{}, len(availableCredentialTypes))
Expand Down

0 comments on commit b81e81d

Please sign in to comment.