updated changelog and formatting

This commit is contained in:
Gani Georgiev
2023-03-28 07:59:37 +03:00
parent 4c903684d8
commit 3ea02c945d
40 changed files with 62 additions and 64 deletions
+5 -5
View File
@@ -33,7 +33,7 @@ type AppleClientSecretCreate struct {
// Usually wrapped within -----BEGIN PRIVATE KEY----- X -----END PRIVATE KEY-----.
PrivateKey string `form:"privateKey" json:"privateKey"`
// Duration specifies how long the generated JWT token should be considered valid
// Duration specifies how long the generated JWT token should be considered valid.
// The specified value must be in seconds and max 15777000 (~6months).
Duration int `form:"duration" json:"duration"`
}
@@ -72,12 +72,12 @@ func (form *AppleClientSecretCreate) Submit() (string, error) {
now := time.Now()
claims := &jwt.StandardClaims{
Audience: "https://appleid.apple.com",
claims := &jwt.RegisteredClaims{
Audience: jwt.ClaimStrings{"https://appleid.apple.com"},
Subject: form.ClientId,
Issuer: form.TeamId,
IssuedAt: now.Unix(),
ExpiresAt: now.Add(time.Duration(form.Duration) * time.Second).Unix(),
IssuedAt: jwt.NewNumericDate(now),
ExpiresAt: jwt.NewNumericDate(now.Add(time.Duration(form.Duration) * time.Second)),
}
token := jwt.NewWithClaims(jwt.SigningMethodES256, claims)
+2 -2
View File
@@ -391,7 +391,7 @@ func (form *CollectionUpsert) checkIndexes(value any) error {
if form.Type == models.CollectionTypeView && len(v) > 0 {
return validation.NewError(
"validation_indexes_not_supported",
fmt.Sprintf("The collection doesn't support indexes."),
"The collection doesn't support indexes.",
)
}
@@ -402,7 +402,7 @@ func (form *CollectionUpsert) checkIndexes(value any) error {
return validation.Errors{
strconv.Itoa(i): validation.NewError(
"validation_invalid_index_expression",
fmt.Sprintf("Invalid CREATE INDEX expression."),
"Invalid CREATE INDEX expression.",
),
}
}
+1 -1
View File
@@ -130,7 +130,7 @@ func (form *RecordOAuth2Login) Submit(
return nil, nil, err
}
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(30*time.Second))
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
provider.SetContext(ctx)