0

I want to give user ability to reset password by sending an email but I don't know how to trigger that email. This is only mobile app so front-end app communicates with the backend app using endpoints. I'm using devise to authenticate user, swagger for testing endpoints and Fast JSON API to serialize.

my mode:

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

  belongs_to :profile, polymorphic: true
end

routes:

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 endpoints:

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

The thing is I don't know how to trigger that email, I've got recoverable module added but how to create that endpoint to test it on swagger?

mr_muscle
  • 2,536
  • 18
  • 61

0 Answers0