Skip to content
Snippets Groups Projects
Unverified Commit 4a3494f5 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

prevent accessing /admin from extranet

parent 919138b7
No related branches found
No related tags found
No related merge requests found
class Admin::ApplicationController < ApplicationController
layout 'admin/layouts/application'
before_action :redirect_if_context_is_not_an_university!
before_action :load_block_copy_cookie
include Admin::Filterable
......@@ -37,4 +38,11 @@ class Admin::ApplicationController < ApplicationController
# If the block doesn't exist anymore
end
private
def redirect_if_context_is_not_an_university!
# Currently (Nov 2023), context can be: an extranet, an university (admin) or none.
redirect_to root_path unless current_context.is_a?(University)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment