Skip to content

Commit

Permalink
feat: Expose user.remaining_lockout_duration_in_seconds in user payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Pitsilos committed Nov 14, 2023
1 parent 9a6dab1 commit 995c0c8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
61 changes: 31 additions & 30 deletions clerk/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,37 @@ 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"`
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"`
RemainingLockoutDurationInSeconds *int64 `json:"remaining_lockout_duration_in_seconds"`
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 @@ -515,7 +515,8 @@ const dummyUserJson = `{
},
"last_sign_in_at": 1610783813,
"banned": false,
"locked": false
"locked": false,
"remaining_lockout_duration_in_seconds": null
}`

const dummyUserOAuthAccessTokensJson = `[
Expand Down

0 comments on commit 995c0c8

Please sign in to comment.