Skip to content

Commit

Permalink
Add Apple to list of providers. (#323)
Browse files Browse the repository at this point in the history
* user_management: add Apple to list of providers.

This may be me completely understanding this code but: this looked like an omission here so I thought I'd open a PR for discussion.

* types/provider: add another missing Apple addition.

* Fix specs

* Fix Rubocop offense

---------

Co-authored-by: Michael Hadley <[email protected]>
  • Loading branch information
MikeMcQuaid and mthadley authored Aug 9, 2024
1 parent 840c795 commit ef7c82d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/workos/types/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Provider
Google = 'GoogleOAuth'
Microsoft = 'MicrosoftOAuth'

ALL = [GitHub, Google, Microsoft].freeze
ALL = [Apple, GitHub, Google, Microsoft].freeze
end
end
end
2 changes: 1 addition & 1 deletion lib/workos/user_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Provider
Microsoft = 'MicrosoftOAuth'
AuthKit = 'authkit'

ALL = [GitHub, Google, Microsoft, AuthKit].freeze
ALL = [Apple, GitHub, Google, Microsoft, AuthKit].freeze
end

# The AuthFactorType is a declaration of a
Expand Down
3 changes: 2 additions & 1 deletion spec/lib/workos/sso_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
described_class.authorization_url(**args)
end.to raise_error(
ArgumentError,
'Okta is not a valid value. `provider` must be in ["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]',
'Okta is not a valid value. `provider` must be in ' \
'["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]',
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/workos/user_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
end.to raise_error(
ArgumentError,
'Okta is not a valid value. `provider` must be in ' \
'["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth", "authkit"]',
'["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth", "authkit"]',
)
end
end
Expand Down

0 comments on commit ef7c82d

Please sign in to comment.