mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 23:59:40 +02:00
Make encryption config optional for self hosting users (#1476)
* Fix redirect 404 bug * Make encryption optional for self-hosters * Fix test
This commit is contained in:
parent
69f6d7f8ea
commit
0af5faaa9f
4 changed files with 19 additions and 3 deletions
|
@ -5,6 +5,8 @@ module StoreLocation
|
|||
helper_method :previous_path
|
||||
before_action :store_return_to
|
||||
after_action :clear_previous_path
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :handle_not_found
|
||||
end
|
||||
|
||||
def previous_path
|
||||
|
@ -12,6 +14,14 @@ module StoreLocation
|
|||
end
|
||||
|
||||
private
|
||||
def handle_not_found
|
||||
if request.fullpath == session[:return_to]
|
||||
session.delete(:return_to)
|
||||
redirect_to fallback_path
|
||||
else
|
||||
head :not_found
|
||||
end
|
||||
end
|
||||
|
||||
def store_return_to
|
||||
if params[:return_to].present?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue