Skip to content

Commit

Permalink
Always redirect to Trestle root on access denied in feature specs
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Sep 9, 2020
1 parent 0feaffc commit 7d16411
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/dummy/config/initializers/trestle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,12 @@
# config.auth.remember.cookie, ->(user) {
# { value: user.remember_token, expires: user.remember_token_expires_at }
# }

config.auth.redirect_on_access_denied = -> {
if authorized?(:index)
admin.path(:index)
else
Trestle.config.root
end
}
end

0 comments on commit 7d16411

Please sign in to comment.