Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose user.remaining_lockout_duration_in_seconds in user payload #181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading