Sha256: 091be3b63cb4d6e10b8963b8bee26e4dbebfd0431417d67a07b1f26d83c34a15
Contents?: true
Size: 1.07 KB
Versions: 3
Compression:
Stored size: 1.07 KB
Contents
class Roda module RodaPlugins module Rodauth CloseAccount = Feature.define(:close_account) do route 'close-account' notice_flash 'Your account has been closed' view 'close-account', 'Close Account' additional_form_tags button 'Close Account' redirect require_account auth_value_methods :account_closed_status_value auth_methods :close_account get_block do |r, auth| auth.close_account_view end post_block do |r, auth| auth.transaction do auth.close_account auth.after_close_account end auth.clear_session auth.set_notice_flash auth.close_account_notice_flash r.redirect(auth.close_account_redirect) end def account_closed_status_value 3 end def close_account account.update(account_status_id=>account_closed_status_value) account.db[password_hash_table].where(account_id=>account_id_value).delete end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rodauth-0.10.0 | lib/roda/plugins/rodauth/close_account.rb |
rodauth-0.9.1 | lib/roda/plugins/rodauth/close_account.rb |
rodauth-0.9.0 | lib/roda/plugins/rodauth/close_account.rb |