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

Code equals nil in WorkOS::MFA.challenge_factor response #325

Open
tomczak-mateusz opened this issue Aug 12, 2024 · 1 comment
Open

Code equals nil in WorkOS::MFA.challenge_factor response #325

tomczak-mateusz opened this issue Aug 12, 2024 · 1 comment

Comments

@tomczak-mateusz
Copy link

Hey, I'm using WorkOS MFA in my customer project & utilise Ruby gem. Everything works as expected but I was able to find one confusing response:

When running a challenge_factor request I can see an attribute code: nil for WorkOS::Challenge in response (and it returns nil for this attribute for any auth_factor_id), example:

irb(main):003> auth_factor_id = Member.find(2).mfa_sms_auth_factor_id
=> "auth_factor_01J50D363JX20ZVRZE2M2P****"

irb(main):004> challenge = WorkOS::MFA.challenge_factor(authentication_factor_id: auth_factor_id)
=>
#<WorkOS::Challenge:0x00000001223d0248
...

irb(main):005> challenge
=>
#<WorkOS::Challenge:0x00000001223d0248
 @authentication_factor_id="auth_factor_01J50D363JX20ZVRZE2M2P****",
 @code=nil,
 @created_at="2024-08-12T12:39:09.808Z",
 @expires_at="2024-08-12T12:49:09.809Z",
 @id="auth_challenge_01J539JZ7MH51DWBTDJ1W6****",
 @object="authentication_challenge",
 @updated_at="2024-08-12T12:39:09.808Z">

I can see that Code is NOT covered in the Authentication Challenge documentation as well:
https://workos.com/docs/reference/user-management/mfa/authentication-challenge
image

I would suggest to either remove Code from response or to document it properly.

@PaulAsjes
Copy link
Contributor

Thanks for the report! That's indeed an unused parameter, I'll make a note to remove this in the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants