]> git.openstreetmap.org Git - rails.git/commitdiff
Clear current_user if we reject OAuth 1
authorTom Hughes <tom@compton.nu>
Sun, 7 Jul 2024 18:40:28 +0000 (19:40 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 7 Jul 2024 18:40:28 +0000 (19:40 +0100)
This ensures we don't try and do any further validation of the
user which might lead to trying to report additional errors.

app/controllers/api_controller.rb

index ff7f694c5eb63bac0ac23c7e00ba454630f7ac69..ae1bc87554e0e0b1da81debd07cf7296df80d2d1 100644 (file)
@@ -112,6 +112,7 @@ class ApiController < ApplicationController
         # self.current_user setup by OAuth
       else
         report_error t("application.oauth_10a_disabled", :link => t("application.auth_disabled_link")), :forbidden
         # self.current_user setup by OAuth
       else
         report_error t("application.oauth_10a_disabled", :link => t("application.auth_disabled_link")), :forbidden
+        self.current_user = nil
       end
     else
       username, passwd = auth_data # parse from headers
       end
     else
       username, passwd = auth_data # parse from headers