Commit 1e45f4fb authored by mh's avatar mh
Browse files

this api endpoint is gone and shall only be used together with auth, the...

this api endpoint is gone and shall only be used together with auth, the verify form was never linked anywhere
parent 1cce0b2b
......@@ -144,10 +144,6 @@ module ApiBackend
post(['users', 'enable_mail_crypt'], {"email"=> user, "password" => pw})
end
def self.verify_totp(user, token)
post(['users', 'verify_totp'], {"email"=> user, "totp" => token})
end
def self.enable_totp(user, name)
post(['users', 'enable_totp'], {"email"=> user, 'name' => name})
end
......
......@@ -38,17 +38,6 @@ class TfaController < ApplicationController
end
def verify
if params[:totp]
begin
ApiBackend::verify_totp(current_user, params[:totp])
flash[:notice] = :success
rescue ApiBackend::ApiError
flash[:notice] = :failed
end
end
end
private
def fetch_existing_2fa
res = ApiBackend::get_totp_names(current_user)
......
<h3><%= @page_title = t(:tfa_verify) %></h3>
<% if @totp_enabled -%>
<%= form_tag('', method: "post") do %>
<%= label_tag(:totp, t(:totp)) %>
<%= text_field_tag(:totp) %>
<br />
<%= submit_tag(t(:submit)) %>
<%= link_to t(:back), root_path %>
<% end
end -%>
......@@ -36,8 +36,6 @@ Rails.application.routes.draw do
get 'tfa', to: 'tfa#show'
post 'tfa', to: 'tfa#enable'
post 'tfa/:name/delete_totp', to: 'tfa#delete_totp'
get 'tfa/verify', to: 'tfa#verify'
post 'tfa/verify', to: 'tfa#verify'
root to: 'welcome#index'
get '/welcome', to: 'welcome#index'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment