-
Notifications
You must be signed in to change notification settings - Fork 9
User Verification feature
Vladislav Trotsenko edited this page Sep 26, 2019
·
2 revisions
This is basic user verification feature. It consists of 1 endpoint.
The point of this endpoint is provide accepting user verification link.
module Api::V1::Users
class VerificationsController < ApiController
def show
endpoint Api::V1::Users::Verifications::Operation::Show
end
end
end
module Api::V1::Users::Verifications::Operation
class Show < ApplicationOperation
step Subprocess(Api::V1::Users::Lib::Operation::DecryptEmailToken), fast_track: true # run nested operation
step :user_account_not_verified? # is user account not verified checking
fail Macro::AddContractError(base: 'errors.verification.user_account_already_verified'), fail_fast: true # add custom error to contract
step :verify_user_account # add verified marker to model
step :create_user # create nested user entity for current account entity
step :send_notification # send email notification about successful user verification
end
end
RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!