File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,15 @@ def patch_user(user_id, body)
111
111
end
112
112
alias update_user patch_user
113
113
114
+ # Delete all authenticators
115
+ # @see https://auth0.com/docs/api/management/v2#!/Users/delete_authenticators
116
+ # @param user_id [string] The user_id of the user to delete all authenticators
117
+ def delete_user_authenticators ( user_id )
118
+ raise Auth0 ::MissingUserId , 'Must supply a valid user_id' if user_id . to_s . empty?
119
+ path = "#{ users_path } /#{ user_id } /authenticators"
120
+ delete ( path )
121
+ end
122
+
114
123
# Delete a user's multifactor provider
115
124
# @see https://auth0.com/docs/api/v2#!/Users/delete_multifactor_by_provider
116
125
# @param user_id [string] The user_id of the user to delete the multifactor provider from.
Original file line number Diff line number Diff line change 139
139
end
140
140
end
141
141
142
+ context '.delete_user_authenticators' do
143
+ it 'is expected to respond to a delete_user_authenticators method' do
144
+ expect ( @instance ) . to respond_to ( :delete_user_authenticators )
145
+ end
146
+
147
+ it 'is expected to delete /api/v2/users/userId/authenticators' do
148
+ expect ( @instance ) . to receive ( :delete ) . with ( '/api/v2/users/USER_ID/authenticators' )
149
+ @instance . delete_user_authenticators ( 'USER_ID' )
150
+ end
151
+
152
+ it 'is expected to raise an exception when the user ID is empty' do
153
+ expect { @instance . delete_user_authenticators ( nil ) } . to raise_exception ( Auth0 ::MissingUserId )
154
+ end
155
+ end
156
+
142
157
context '.delete_user_provider' do
143
158
it 'is expected to respond to a delete_user_provider method' do
144
159
expect ( @instance ) . to respond_to ( :delete_user_provider )
You can’t perform that action at this time.
0 commit comments