Class: Monban::UseCase::Auth::Token::Authy
- Includes:
- Helper
- Defined in:
- lib/monban/use_case/auth/token/authy.rb
Instance Method Summary collapse
Instance Method Details
#create(params) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/monban/use_case/auth/token/authy.rb', line 32 def create(params) Getto::Params.new.validate(params) do |v| v.hash( account_id: v.integer{|val| param_error!(account_id: val) }, ) end or param_error!(params: params) repository.transaction do auth.authy( public_id: generate_public_id!(account_id: params[:account_id]), authy_id: repository.authy_id(account_id: params[:account_id]), expired_at: time.now + expire, ) end end |