Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Email verification object returns nil in Ruby SDK despite verified emails #104

@jiteshatzeals

Description

@jiteshatzeals

Bug Description

The Clerk Ruby SDK is not properly deserializing the verification object from email addresses, even when emails are verified in the Clerk dashboard.

Expected vs Actual Behavior

Expected:

email = user.email_addresses.first
email.verification.status # Should return "verified"

Actual:

email = user.email_addresses.first
email.verification # Returns nil
email.verification&.status # Returns nil

Versions Affected

  • clerk-sdk-ruby v4.2.1
  • clerk-sdk-ruby v4.1.0
  • clerk-sdk-ruby v4.0.1

Reproduction Steps

  1. Install any version of clerk-sdk-ruby
  2. Set up Clerk with a verified email address
  3. Run this code:
require 'clerk'

Clerk.configure { |config| config.secret_key = ENV['CLERK_SECRET_KEY'] }
client = Clerk::SDK.new

user = client.users.get_user('user_id_with_verified_email')
email = user.email_addresses.first

puts "Email: #{email.email_address}"
puts "Verification object: #{email.verification.inspect}"
puts "Verification status: #{email.verification&.status}"
  1. Expected: Should show verification data
  2. Actual: Shows nil for verification object

Important Note

Direct API calls work correctly and return verification data:

curl -H "Authorization: Bearer $CLERK_SECRET_KEY" \
     "https://api.clerk.com/v1/users/user_id" | jq '.email_addresses[0].verification'

This returns proper verification object with status, but the SDK doesn't deserialize it correctly.

Impact

  • Cannot properly verify email status in applications
  • Forces developers to use direct API calls as workarounds
  • Affects security and user experience

Environment

  • Ruby 3.2.2, Rails 8.0.1
  • Production Clerk instance
  • Email verified in Clerk dashboard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions