UX: detect DiscourseHub user agent in recently used devices

UX: detect DiscourseHub user agent in recently used devices

diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 7d283de..68d599d 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -746,6 +746,7 @@ en:
       opera: "Opera"
       ie: "Internet Explorer"
       edge: "Microsoft Edge"
+      discoursehub: "DiscourseHub app"
       unknown: "unknown browser"
     device:
       android: "Android Device"
diff --git a/lib/browser_detection.rb b/lib/browser_detection.rb
index 78d5bd1..a19e14c 100644
--- a/lib/browser_detection.rb
+++ b/lib/browser_detection.rb
@@ -14,6 +14,8 @@ module BrowserDetection
       :safari
     when /MSIE/i, /Trident/i
       :ie
+    when /DiscourseHub/i
+      :discoursehub
     else
       :unknown
     end

GitHub sha: cec0b580

1 Like

This is awesome!

No need to super gold plate this quite yet, but for next major release we could look at associating with the user api key, that way if you log out from the api key section we would delete the device here and if you delete from logged on devices we would invalidate the user api key.

2 Likes