diff --git a/Gemfile b/Gemfile
index 4c5c885cfc2bf555b355a432b802616aba4690d1..4f543d5938d97c8191964b6c68c5d7ac4e0d61c2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -58,7 +58,7 @@ gem 'akismet', '~> 3.0'
 gem 'invisible_captcha', '~> 0.12.1'
 
 # Two-factor authentication
-gem 'devise-two-factor', '~> 3.0.0'
+gem 'devise-two-factor', '~> 3.1.0'
 gem 'rqrcode-rails3', '~> 0.1.7'
 gem 'attr_encrypted', '~> 3.1.0'
 gem 'u2f', '~> 0.2.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index 19b107f41f0f1af98ae7c60773a7b4e7eafd37f1..724021ced7c3189d098be6716c965ffd992f0a3f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -229,11 +229,11 @@ GEM
       railties (>= 4.1.0)
       responders
       warden (~> 1.2.3)
-    devise-two-factor (3.0.0)
-      activesupport
+    devise-two-factor (3.1.0)
+      activesupport (< 6.1)
       attr_encrypted (>= 1.3, < 4, != 2)
       devise (~> 4.0)
-      railties
+      railties (< 6.1)
       rotp (~> 2.0)
     diff-lcs (1.3)
     diff_match_patch (0.1.0)
@@ -1193,7 +1193,7 @@ DEPENDENCIES
   derailed_benchmarks
   device_detector
   devise (~> 4.6)
-  devise-two-factor (~> 3.0.0)
+  devise-two-factor (~> 3.1.0)
   diff_match_patch (~> 0.1.0)
   diffy (~> 3.1.0)
   discordrb-webhooks-blackst0ne (~> 3.3)