summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sessions_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 8919a4d..4818191 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -16,6 +16,14 @@ class SessionsController < ApplicationController
end
#
+ # Warden will catch all 401s and run this instead:
+ #
+ def unauthenticated
+ render json: {error: t(:not_authorized_login)},
+ status: :unauthorized
+ end
+
+ #
# this is a bad hack, but user_url(user) is not available
# also, this doesn't work because the redirect happens as a PUT. no idea why.
#