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

Add API changes for invitations and Magic Auth #293

Merged
merged 2 commits into from
May 3, 2024

Conversation

blairworkos
Copy link
Contributor

@blairworkos blairworkos commented May 3, 2024

Description

Adds API changes to support sending your own emails for invitations and Magic Auth.

  • Adds accept_invitation_url to invitation object returned by API
  • Adds new endpoints for the Magic Auth API: get_magic_auth and create_magic_auth
  • Deprecates current send_magic_auth_code method in favor of create_magic_auth

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[x] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

https://github.com/workos/workos/pull/26691

@blairworkos blairworkos self-assigned this May 3, 2024
Copy link

linear bot commented May 3, 2024

DAAP-600 Ruby SDK

@blairworkos blairworkos requested a review from mthadley May 3, 2024 00:12
@blairworkos blairworkos requested review from a team and PaulAsjes May 3, 2024 15:13
@blairworkos blairworkos changed the title Add events and API changes for invitations and Magic Auth Add API changes for invitations and Magic Auth May 3, 2024
Copy link

@tribble tribble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

Comment on lines +647 to +658
context 'with valid payload' do
it 'creates a magic_auth' do
VCR.use_cassette 'user_management/create_magic_auth/valid' do
magic_auth = described_class.create_magic_auth(
email: 'test@workos.com',
)

expect(magic_auth.id).to eq('magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9')
expect(magic_auth.email).to eq('test@workos.com')
end
end
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we generally test other variations? There is also a version of this method that accepts an invitation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes - testing is a bit spotty in the SDKs. The invitation_token is optional for this method, and it's only needed in a specific case: sign ups are turned off and there isn't already a user with the email.

I'll add a follow up item to add a test for that case. I need to get my dashboard in a specific state to do that test.

@blairworkos blairworkos merged commit 1255b33 into main May 3, 2024
4 checks passed
@blairworkos blairworkos deleted the feature/daap-600-ruby-sdk branch May 3, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants