Skip to content

Commit

Permalink
chore: Rename user lockout fields so that they are prefixed with the …
Browse files Browse the repository at this point in the history
…most common Clerk term
  • Loading branch information
Mark Pitsilos authored and yourtallness committed Nov 21, 2023
1 parent 2781410 commit 1bc3634
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
63 changes: 32 additions & 31 deletions clerk/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,38 @@ import (
type UsersService service

type User struct {
ID string `json:"id"`
Object string `json:"object"`
Username *string `json:"username"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
Gender *string `json:"gender"`
Birthday *string `json:"birthday"`
ProfileImageURL string `json:"profile_image_url"`
ImageURL *string `json:"image_url,omitempty"`
HasImage bool `json:"has_image"`
PrimaryEmailAddressID *string `json:"primary_email_address_id"`
PrimaryPhoneNumberID *string `json:"primary_phone_number_id"`
PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id"`
PasswordEnabled bool `json:"password_enabled"`
TwoFactorEnabled bool `json:"two_factor_enabled"`
TOTPEnabled bool `json:"totp_enabled"`
BackupCodeEnabled bool `json:"backup_code_enabled"`
EmailAddresses []EmailAddress `json:"email_addresses"`
PhoneNumbers []PhoneNumber `json:"phone_numbers"`
Web3Wallets []Web3Wallet `json:"web3_wallets"`
ExternalAccounts []interface{} `json:"external_accounts"`
PublicMetadata interface{} `json:"public_metadata"`
PrivateMetadata interface{} `json:"private_metadata"`
UnsafeMetadata interface{} `json:"unsafe_metadata"`
LastSignInAt *int64 `json:"last_sign_in_at"`
Banned bool `json:"banned"`
Locked bool `json:"locked"`
RemainingLockoutDurationInSeconds *int64 `json:"remaining_lockout_duration_in_seconds"`
ExternalID *string `json:"external_id"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
ID string `json:"id"`
Object string `json:"object"`
Username *string `json:"username"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
Gender *string `json:"gender"`
Birthday *string `json:"birthday"`
ProfileImageURL string `json:"profile_image_url"`
ImageURL *string `json:"image_url,omitempty"`
HasImage bool `json:"has_image"`
PrimaryEmailAddressID *string `json:"primary_email_address_id"`
PrimaryPhoneNumberID *string `json:"primary_phone_number_id"`
PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id"`
PasswordEnabled bool `json:"password_enabled"`
TwoFactorEnabled bool `json:"two_factor_enabled"`
TOTPEnabled bool `json:"totp_enabled"`
BackupCodeEnabled bool `json:"backup_code_enabled"`
EmailAddresses []EmailAddress `json:"email_addresses"`
PhoneNumbers []PhoneNumber `json:"phone_numbers"`
Web3Wallets []Web3Wallet `json:"web3_wallets"`
ExternalAccounts []interface{} `json:"external_accounts"`
PublicMetadata interface{} `json:"public_metadata"`
PrivateMetadata interface{} `json:"private_metadata"`
UnsafeMetadata interface{} `json:"unsafe_metadata"`
LastSignInAt *int64 `json:"last_sign_in_at"`
Banned bool `json:"banned"`
Locked bool `json:"locked"`
LockoutExpiresInSeconds *int64 `json:"lockout_expires_in_seconds"`
VerificationAttemptsRemaining *int64 `json:"verification_attempts_remaining"`
ExternalID *string `json:"external_id"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}

type UserOAuthAccessToken struct {
Expand Down
3 changes: 2 additions & 1 deletion clerk/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ const dummyUserJson = `{
"last_sign_in_at": 1610783813,
"banned": false,
"locked": false,
"remaining_lockout_duration_in_seconds": null
"lockout_expires_in_seconds": null,
"verification_attempts_remaining": null
}`

const dummyUserOAuthAccessTokensJson = `[
Expand Down

0 comments on commit 1bc3634

Please sign in to comment.