Initial commit
This commit is contained in:
19
app/api/v2/account/utils.rb
Normal file
19
app/api/v2/account/utils.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
module API
|
||||
module V2
|
||||
module Account
|
||||
module Utils
|
||||
def session
|
||||
request.session
|
||||
end
|
||||
|
||||
def publish_confirmation_code(user, action)
|
||||
totp = ::Vault::TOTPAction.new(action)
|
||||
totp.create(user.uid, user.email)
|
||||
::EventAPI.notify(action, record: { user: user.as_json_for_event_api,
|
||||
domain: Peatio::App.config.domain,
|
||||
code: totp.read_code(user.uid) })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user