Commit 00949724 authored by Birger Schacht's avatar Birger Schacht
Browse files

Add a simple empty page for flash messages

The TfaController now routes requests there instead of the
welcome page.
parent e138a159
Pipeline #584 failed with stage
......@@ -211,4 +211,7 @@ class ApplicationController < ActionController::Base
def log_exception(exc)
logger.error "Exception caught: #{exc.inspect}\n#{exc.backtrace.join("\n")}"
end
def msg
end
end
......@@ -135,11 +135,11 @@ class TfaController < ApplicationController
def require_tfa_enabled
unless tfa_enabled?
if mail_crypt_enabled?
flash[:notice] = t(:tfa_not_available) + ' - ' + t(:requires_recovery_email)
flash[:danger] = t(:tfa_not_available) + ' - ' + t(:requires_recovery_email)
else
flash[:notice] = t(:tfa_not_available) + ' - ' + t(:requires_secured_mailbox)
flash[:danger] = t(:tfa_not_available) + ' - ' + t(:requires_secured_mailbox)
end
redirect_to root_path
redirect_to msg_path
end
end
......
<% flash.each do |name, msg| %>
<div class="alert alert-<%= name %>"><%= msg %></div>
<% end %>
......@@ -61,6 +61,8 @@ Rails.application.routes.draw do
root to: 'welcome#index'
get '/welcome', to: 'welcome#index'
get '/msg', to: 'application#msg'
else
root to: 'admin#index'
......
Markdown is supported
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