Module: Auth0::Api::V2::Prompts

Included in:
Auth0::Api::V2
Defined in:
lib/auth0/api/v2/prompts.rb

Instance Method Summary collapse

Instance Method Details

#custom_text(prompt, language) ⇒ json Also known as: get_custom_text

Get custom text for a prompt Retrieve custom text for a specific prompt and language.

Parameters:

  • prompt (string)

    Prompt of custom texts to update.

  • language (string)

    Language of custom texts to update.

Returns:

  • (json)

    Returns the custom texts.

Raises:

See Also:



36
37
38
39
40
41
42
# File 'lib/auth0/api/v2/prompts.rb', line 36

def custom_text(prompt, language)
  raise Auth0::InvalidParameter, 'Must supply a valid prompt' if prompt.to_s.empty?
  raise Auth0::InvalidParameter, 'Must supply a valid language' if language.to_s.empty?

  path = "#{prompts_path}/#{prompt}/custom-text/#{language}"
  get(path)
end

#patch_prompts(options = {}) ⇒ json Also known as: update_prompts

Update prompts settings.

Parameters:

  • options (hash) (defaults to: {})
    • :universal_login_experience [string] Should be any of: new, classic.

Returns:

  • (json)

    Returns the prompts settings.

See Also:



21
22
23
24
25
26
# File 'lib/auth0/api/v2/prompts.rb', line 21

def patch_prompts(options = {})
  request_params = {
    universal_login_experience: options.fetch(:universal_login_experience, nil)
  }
  patch(prompts_path, request_params)
end

#promptsjson Also known as: get_prompts

Get prompts settings.

Returns:

  • (json)

    Returns the prompts setting.

See Also:



10
11
12
# File 'lib/auth0/api/v2/prompts.rb', line 10

def prompts
  get(prompts_path)
end

#put_custom_text(prompt, language, body) ⇒ json Also known as: update_custom_text

Set custom text for a specific prompt Existing texts will be overwritten.

Parameters:

  • prompt (string)

    Prompt of custom texts to update.

  • language (string)

    Language of custom texts to update.

  • body (hash)

    Custom texts.

Returns:

  • (json)

    Returns the custom texts.

Raises:

See Also:



53
54
55
56
57
58
59
# File 'lib/auth0/api/v2/prompts.rb', line 53

def put_custom_text(prompt, language, body)
  raise Auth0::InvalidParameter, 'Must supply a valid prompt' if prompt.to_s.empty?
  raise Auth0::InvalidParameter, 'Must supply a valid language' if language.to_s.empty?

  path = "#{prompts_path}/#{prompt}/custom-text/#{language}"
  put(path, body)
end