Rails создает конечную точку электронной почты для сброса пароля с помощью devise - PullRequest
0 голосов
/ 04 мая 2020

Я хочу дать пользователю возможность сбросить пароль, отправив электронное письмо, но я не знаю, как вызвать это электронное письмо. Это только мобильное приложение, поэтому интерфейсное приложение связывается с внутренним приложением с помощью конечных точек. Я использую devise для аутентификации пользователя, swagger для тестирования конечных точек и Fast JSON API для сериализации.

мой режим:

class Account < ApplicationRecord
  devise :database_authenticatable, :registerable, :recoverable, :validatable,
         :jwt_authenticatable, jwt_revocation_strategy: JwtBlacklist

  belongs_to :profile, polymorphic: true
end

маршруты:

root@5539feaef343:/usr/src/app# rake routes | grep account
         new_account_session GET    /api/v1/account/sign_in(.:format)                                                        api/v1/account/sessions#new {:format=>:json}
             account_session POST   /api/v1/account/sign_in(.:format)                                                        api/v1/account/sessions#create {:format=>:json}
     destroy_account_session DELETE /api/v1/account/sign_out(.:format)                                                       api/v1/account/sessions#destroy {:format=>:json}
        new_account_password GET    /api/v1/account/password/new(.:format)                                                   api/v1/account/passwords#new {:format=>:json}
       edit_account_password GET    /api/v1/account/password/edit(.:format)                                                  api/v1/account/passwords#edit {:format=>:json}
            account_password PATCH  /api/v1/account/password(.:format)                                                       api/v1/account/passwords#update {:format=>:json}
                             PUT    /api/v1/account/password(.:format)                                                       api/v1/account/passwords#update {:format=>:json}
                             POST   /api/v1/account/password(.:format)                                                       api/v1/account/passwords#create {:format=>:json}
 cancel_account_registration GET    /api/v1/account/cancel(.:format)                                                         api/v1/account/registrations#cancel {:format=>:json}
    new_account_registration GET    /api/v1/account/sign_up(.:format)                                                        api/v1/account/registrations#new {:format=>:json}
   edit_account_registration GET    /api/v1/account/edit(.:format)                                                           api/v1/account/registrations#edit {:format=>:json}
        account_registration PATCH  /api/v1/account(.:format)                                                                api/v1/account/registrations#update {:format=>:json}
                             PUT    /api/v1/account(.:format)                                                                api/v1/account/registrations#update {:format=>:json}
                             DELETE /api/v1/account(.:format)                                                                api/v1/account/registrations#destroy {:format=>:json}
                             POST   /api/v1/account(.:format)                                                                api/v1/account/registrations#create {:format=>:json}
              api_v1_account GET    /api/v1/account(.:format)                                                                api/v1/accounts#show {:format=>:json}

Конечные точки Swagger:

GET/api/v1/account
Retrieves an account details

POST /api/v1/account
Creates new account

PUT /api/v1/account
Updates the account

DELETE /api/v1/account
Removes the account

POST /api/v1/account/sign_in
Log in with account

DELETE /api/v1/account/sign_out

Дело в том, что я не знаю, как вызвать эту электронную почту, у меня есть добавленный модуль recoverable, но как создать эту конечную точку для проверки ее на Swagger?

...