]> cat aescling's git repositories - mastodon.git/commitdiff
Do not store last visited URL from API controllers (#1330)
authorEugen <eugen@zeonfederated.com>
Sun, 9 Apr 2017 20:21:52 +0000 (22:21 +0200)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2017 20:21:52 +0000 (22:21 +0200)
Sign-in redirects you back to last visited URL, but in case of API requests,
this sometimes redirected users to an API URL that, of course, greeted them
with an {"error":"The access token is invalid"}

app/controllers/api_controller.rb

index db16f82e5b91c026dbaf055df34fbf9ee16433ed..57604f1dc4076eab73e6d12e34a113387c2ee739 100644 (file)
@@ -7,6 +7,7 @@ class ApiController < ApplicationController
   protect_from_forgery with: :null_session
 
   skip_before_action :verify_authenticity_token
+  skip_before_action :store_current_location
 
   before_action :set_rate_limit_headers