Fix edit settings test

This commit is contained in:
Zoe Roux 2025-04-06 14:36:03 +02:00
parent 026ad817bc
commit 29704e2f26
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View File

@ -23,13 +23,12 @@ Authorization: Bearer {{jwt}}
}
HTTP 200
[Asserts]
jsonpath ".claims.preferOriginal" == true
jsonpath ".username" == "edit-settings"
jsonpath "$.claims.preferOriginal" == true
jsonpath "$.username" == "edit-settings"
# Invalid password login
POST {{host}}/jwt
GET {{host}}/jwt
Authorization: Bearer {{token}}
HTTP 403
HTTP 200
DELETE {{host}}/users/me
Authorization: Bearer {{jwt}}

View File

@ -53,8 +53,8 @@ type RegisterDto struct {
}
type EditUserDto struct {
Username *string `json:"username,omitempty" validate:"excludes=@" example:"zoriya"`
Email *string `json:"email,omitempty" validate:"email" example:"kyoo@zoriya.dev"`
Username *string `json:"username,omitempty" validate:"omitnil,excludes=@" example:"zoriya"`
Email *string `json:"email,omitempty" validate:"omitnil,email" example:"kyoo@zoriya.dev"`
Claims jwt.MapClaims `json:"claims,omitempty" example:"preferOriginal: true"`
}