class Base::Endpoints::Passwords

This endpoint contains methods for handling the forgot password flow.

Public Class Methods

new(access_token:, url:) click to toggle source

Initializes this endpoint.

Calls superclass method Base::Endpoint::new
# File lib/base/endpoints/passwords.rb, line 8
def initialize(access_token:, url:)
  @path = 'password'
  super
end

Public Instance Methods

forgot_password(email:) click to toggle source

Generates a forgot password token for the user with the given email.

# File lib/base/endpoints/passwords.rb, line 14
def forgot_password(email:)
  request do
    response =
      connection.post('',
                      'email' => email)

    parse(response.body)
  end
end
set_password(forgot_password_token:, confirmation:, password:) click to toggle source

Sets the password of a user with the given forgot password token.

# File lib/base/endpoints/passwords.rb, line 25
def set_password(forgot_password_token:,
                 confirmation:,
                 password:)
  request do
    response =
      connection.put('',
                     'forgot_password_token' => forgot_password_token,
                     'confirmation' => confirmation,
                     'password' => password)

    parse(response.body)
  end
end