Skip to content

Commit

Permalink
Remove enum constants
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Dec 5, 2023
1 parent f3bf834 commit 9d76be0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
9 changes: 0 additions & 9 deletions lib/workos/sso.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ defmodule WorkOS.SSO do
alias WorkOS.SSO.Profile
alias WorkOS.SSO.ProfileAndToken

@provider_types ["GoogleOAuth", "MicrosoftOAuth"]

@doc """
Lists all connections.
Expand Down Expand Up @@ -110,13 +108,6 @@ defmodule WorkOS.SSO do
when is_map_key(params, :redirect_uri) and
(is_map_key(params, :connection) or is_map_key(params, :organization) or
is_map_key(params, :provider)) do
if is_map_key(params, :provider) and params[:provider] not in @provider_types do
raise(ArgumentError,
message:
"#{params[:provider]} is not a valid value. `provider` must be in #{@provider_types}"
)
end

client_id =
params[:client_id] || WorkOS.client_id() ||
raise "Missing required `client_id` parameter."
Expand Down
16 changes: 0 additions & 16 deletions lib/workos/user_management.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ defmodule WorkOS.UserManagement do
alias WorkOS.UserManagement.ResetPassword
alias WorkOS.UserManagement.User

@provider_types ["authkit", "GoogleOAuth", "MicrosoftOAuth"]
@factor_types ["totp"]

@doc """
Generates an OAuth 2.0 authorization URL.
Expand All @@ -40,13 +37,6 @@ defmodule WorkOS.UserManagement do
when is_map_key(params, :redirect_uri) and
(is_map_key(params, :connection_id) or is_map_key(params, :organization_id) or
is_map_key(params, :provider)) do
if is_map_key(params, :provider) and params[:provider] not in @provider_types do
raise(ArgumentError,
message:
"#{params[:provider]} is not a valid value. `provider` must be in #{@provider_types}"
)
end

client_id =
params[:client_id] || WorkOS.client_id() ||
raise "Missing required `client_id` parameter."
Expand Down Expand Up @@ -457,12 +447,6 @@ defmodule WorkOS.UserManagement do
@spec enroll_auth_factor(WorkOS.Client.t(), String.t(), map()) ::
WorkOS.Client.response(EnrollAuthFactor.t())
def enroll_auth_factor(client \\ WorkOS.client(), user_id, opts) when is_map_key(opts, :type) do
if opts[:type] not in @factor_types do
raise(ArgumentError,
message: "#{opts[:type]} is not a valid value. `type` must be in #{@factor_types}"
)
end

WorkOS.Client.post(
client,
EnrollAuthFactor,
Expand Down

0 comments on commit 9d76be0

Please sign in to comment.