Updated store_location_for for redirecting after sign in
• Updated: - store_location_for for redirecting after sign in
This commit is contained in:
parent
e849c42c7b
commit
9d61659604
@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def store_current_location
|
def store_current_location
|
||||||
store_location_for(:user, request.url) unless request.format == :json
|
store_location_for(:user, request.url) if request.format == :html
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_admin!
|
def require_admin!
|
||||||
|
@ -52,7 +52,13 @@ class Auth::SessionsController < Devise::SessionsController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_in_path_for(resource)
|
def after_sign_in_path_for(resource)
|
||||||
return '/home'
|
last_url = stored_location_for(:user)
|
||||||
|
|
||||||
|
if home_paths(resource).include?(last_url)
|
||||||
|
root_path
|
||||||
|
else
|
||||||
|
last_url || root_path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_out_path_for(_resource_or_scope)
|
def after_sign_out_path_for(_resource_or_scope)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ManifestsController < ApplicationController
|
class ManifestsController < ApplicationController
|
||||||
|
skip_before_action :store_current_location
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render json: InstancePresenter.new, serializer: ManifestSerializer
|
render json: InstancePresenter.new, serializer: ManifestSerializer
|
||||||
end
|
end
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
class MediaController < ApplicationController
|
class MediaController < ApplicationController
|
||||||
include Authorization
|
include Authorization
|
||||||
|
|
||||||
|
skip_before_action :store_current_location
|
||||||
|
|
||||||
before_action :set_media_attachment
|
before_action :set_media_attachment
|
||||||
before_action :verify_permitted_status!
|
before_action :verify_permitted_status!
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
class MediaProxyController < ApplicationController
|
class MediaProxyController < ApplicationController
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
|
skip_before_action :store_current_location
|
||||||
|
|
||||||
def show
|
def show
|
||||||
RedisLock.acquire(lock_options) do |lock|
|
RedisLock.acquire(lock_options) do |lock|
|
||||||
if lock.acquired?
|
if lock.acquired?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user