Class: Aikotoba::UnlocksController

Inherits:
ApplicationController show all
Includes:
Protection::RateLimiting
Defined in:
app/controllers/aikotoba/unlocks_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#aikotoba_controller?

Methods included from Scopable

#aikotoba_scope, #aikotoba_scope_config, #aikotoba_scoped_path

Methods included from EnabledFeatureCheckable

#confirmable?, #lockable?, #recoverable?, #registerable?

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/aikotoba/unlocks_controller.rb', line 18

def create
   = find_by_send_token_account!(unlock_accounts_params)
  before_send_unlock_token_process
  send_token_account!()
  after_send_unlock_token_process
rescue ActiveRecord::RecordNotFound => e
  failed_send_unlock_token_process(e)
ensure
  # NOTE: Always show success message to avoid account enumeration.
  redirect_to success_send_unlock_token_path, flash: {notice: success_send_unlock_token_message}
end

#newObject



14
15
16
# File 'app/controllers/aikotoba/unlocks_controller.rb', line 14

def new
  @account = ({email: "", password: ""})
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/aikotoba/unlocks_controller.rb', line 30

def update
   = find_by_has_token_account!(params)
  before_unlock_process
  unlock_account!()
  after_unlock_process
  redirect_to after_unlocked_path, flash: {notice: unlocked_message}
end