summaryrefslogtreecommitdiff
path: root/users/app/controllers/controller_extension
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/controllers/controller_extension')
-rw-r--r--users/app/controllers/controller_extension/authentication.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/app/controllers/controller_extension/authentication.rb b/users/app/controllers/controller_extension/authentication.rb
index e83d6b2..03d3989 100644
--- a/users/app/controllers/controller_extension/authentication.rb
+++ b/users/app/controllers/controller_extension/authentication.rb
@@ -19,6 +19,13 @@ module ControllerExtension::Authentication
access_denied unless logged_in?
end
+ # some actions only make sense if you are not logged in yet.
+ # (login, signup). If a user tries to perform these they will
+ # be redirected to their dashboard.
+ def redirect_if_logged_in
+ redirect_to home_url if logged_in?
+ end
+
def access_denied
respond_to do |format|
format.html do