aboutsummaryrefslogtreecommitdiff
path: root/src/actions/mixins/auth/test_backdoor.cr
blob: 68c9d91a309ec44ea6572e7acc483826cda6dbd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Auth::TestBackdoor
  macro included
    before test_backdoor
  end

  private def test_backdoor
    if LuckyEnv.test? && (user_id = params.get?(:backdoor_user_id))
      user = UserQuery.find(user_id)
      sign_in user
    end
    continue
  end
end