Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
FEATURE: add simple get route to impersonate any user.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothkannans committed Mar 12, 2021
1 parent 0f6b550 commit f640243
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

DiscourseDev::Engine.routes.draw do
get ':username_or_email/become' => 'admin/impersonate#create', constraints: AdminConstraint.new
end
3 changes: 2 additions & 1 deletion lib/discourse_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
I18n.reload! if I18n.backend.initialized?

module DiscourseDev
require 'discourse_dev/railtie' if defined?(Rails)
require 'discourse_dev/railtie'
require 'discourse_dev/engine'
end
5 changes: 5 additions & 0 deletions lib/discourse_dev/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module DiscourseDev
class Engine < Rails::Engine; end
end

0 comments on commit f640243

Please sign in to comment.