about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-13 16:49:52 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-13 16:51:34 +0200
commit33f7e1cf996b9f87784cb1218885d9acbc718944 (patch)
treefad5ea67649e709d96e8267e6d767a598ba00df0 /app
parent157f03f8bdbca1b34895099b38e5f2a1aeb1bd23 (diff)
Shorten rendered links (strip protocol and www, truncate to 30 chars), redirect
to sign in page after sign up instead of root path which redirects to /about
Diffstat (limited to 'app')
-rw-r--r--app/controllers/auth/registrations_controller.rb2
-rw-r--r--app/lib/formatter.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb
index 71eb0905e..7b7f6b52d 100644
--- a/app/controllers/auth/registrations_controller.rb
+++ b/app/controllers/auth/registrations_controller.rb
@@ -17,6 +17,6 @@ class Auth::RegistrationsController < Devise::RegistrationsController
   end
 
   def after_sign_up_path_for(_resource)
-    root_path
+    new_user_session_path
   end
 end
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 17d2dfc58..60bc3733e 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -29,7 +29,9 @@ class Formatter
   end
 
   def link_urls(html)
-    auto_link(html, link: :urls, html: { rel: 'nofollow noopener' })
+    auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) do |text|
+      truncate(text.gsub(/\Ahttps?:\/\/(www\.)?/, ''), length: 30)
+    end
   end
 
   def link_mentions(html, mentions)