Sha256: 4ed294be77ff203715ce858176a2c7a8dbd6c522676de49831a76ce17f9e490d
Contents?: true
Size: 1.09 KB
Versions: 7
Compression:
Stored size: 1.09 KB
Contents
require "monban/core" require "monban/use_case/base" require "getto/params" module Monban module UseCase module Auth module Verify class ResetToken < Base include Getto::InitializeWith initialize_with( error: Monban::Core::ERRORS, time: [:now], repository: [ :valid_reset_password_token?, ], ) def verify(params) Getto::Params.new.validate(params) do |v| v.hash( account_id: v.integer {|val| param_error!(account_id: val) }, reset_token: v.combine([v.string, v.not_empty]){|val| param_error!(reset_token: val) }, ) end or param_error!(params: params) repository.valid_reset_password_token?( account_id: params[:account_id], reset_token: params[:reset_token], now: time.now ) or error.invalid_account! "reset_token failed: #{params}" nil end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems