]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Set font on title
[rails.git] / app / controllers / application_controller.rb
index 09a35beb351f67ac3e40e4eb7caa9023fd2e2396..354fcc7c0cba1b61e3a3d04f73e0e9ddcf0f3fbf 100644 (file)
@@ -419,6 +419,16 @@ class ApplicationController < ActionController::Base
 
   helper_method :preferred_editor
 
+  def update_totp
+    if defined?(TOTP_KEY)
+      cookies["_osm_totp_token"] = {
+        :value => ROTP::TOTP.new(TOTP_KEY, :interval => 3600).now,
+        :domain => "openstreetmap.org",
+        :expires => 1.hour.from_now
+      }
+    end
+  end
+
   private
 
   # extract authorisation credentials from headers, returns user = nil if none