Class: Tyrant::SignUp::Confirmed

Inherits:
Trailblazer::Operation
  • Object
show all
Includes:
Model
Defined in:
lib/tyrant/sign_up.rb

Instance Method Summary collapse

Instance Method Details

#process(params) ⇒ Object

  • no password, unconfirmed, needs password.



41
42
43
44
45
46
47
# File 'lib/tyrant/sign_up.rb', line 41

def process(params)
  validate(params[:user]) do |contract|
    update!

    contract.save # save User with email.
  end
end

#update!Object



49
50
51
52
53
54
# File 'lib/tyrant/sign_up.rb', line 49

def update!
  auth = Tyrant::Authenticatable.new(contract.model)
  auth.digest!(contract.password) # contract.auth_meta_data.password_digest = ..
  auth.confirmed!
  auth.sync
end