Module: Auth0::Api::V2::Tickets
- Included in:
- Auth0::Api::V2
- Defined in:
- lib/auth0/api/v2/tickets.rb
Overview
Methods to use the tickets endpoints
Instance Method Summary collapse
-
#post_email_verification(user_id, result_url: nil, ttl_sec: nil, identity: nil) ⇒ json
Create an email verification ticket After expiration, the ticket cannot be used to verify the user’s email.
-
#post_password_change(result_url: nil, user_id: nil, connection_id: nil, email: nil, ttl_sec: nil, mark_email_as_verified: nil, includeEmailInRedirect: nil, new_password: nil) ⇒ json
Create a password change ticket changed.
Instance Method Details
#post_email_verification(user_id, result_url: nil, ttl_sec: nil, identity: nil) ⇒ json
Create an email verification ticket After expiration, the ticket cannot be used to verify the user’s email. If not specified or if you send 0, the Auth0 default lifetime of five days will be applied
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/auth0/api/v2/tickets.rb', line 20 def post_email_verification(user_id, result_url: nil, ttl_sec: nil, identity: nil) if user_id.to_s.empty? raise Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification' end path = "#{tickets_path}/email-verification" request_params = { user_id: user_id, result_url: result_url, ttl_sec: ttl_sec.is_a?(Integer) ? ttl_sec : nil } if identity unless identity.is_a? Hash raise Auth0::InvalidParameter, 'Identity must be a hash to post an email verification' end request_params[:identity] = identity end post(path, request_params) end |
#post_password_change(result_url: nil, user_id: nil, connection_id: nil, email: nil, ttl_sec: nil, mark_email_as_verified: nil, includeEmailInRedirect: nil, new_password: nil) ⇒ json
Create a password change ticket changed. If sending this parameter, the email is also required and the user_id is invalid. expiration, the ticket cannot be used to change the user’s password. If not specified or if you send 0, the Auth0 default lifetime of 5 days will be applied. changed, false if email_verified attribute should not be updated in the reset_email
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/auth0/api/v2/tickets.rb', line 58 def post_password_change( result_url: nil, user_id: nil, connection_id: nil, email: nil, ttl_sec: nil, mark_email_as_verified: nil, includeEmailInRedirect: nil, new_password: nil) booleans = [true, false] path = "#{tickets_path}/password-change" request_params = { result_url: result_url, user_id: user_id, connection_id: connection_id, email: email, ttl_sec: ttl_sec.is_a?(Integer) ? ttl_sec : nil, mark_email_as_verified: booleans.include?(mark_email_as_verified) ? mark_email_as_verified : nil, includeEmailInRedirect: booleans.include?(includeEmailInRedirect) ? includeEmailInRedirect : nil, new_password: new_password } post(path, request_params) end |