diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fb29d7f3..71d3d6ea 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -65,10 +65,7 @@ private end def get_invite_link - unsafe_uri = request.env["REQUEST_URI"] || 'https://metamaps.cc' - valid_url = /^https?:\/\/([\w\.-]+)(:\d{1,5})?\/?$/ - safe_uri = (unsafe_uri.match(valid_url)) ? unsafe_uri : '//metamaps.cc/' - @invite_link = "#{safe_uri}join" + (current_user ? "?code=#{current_user.code}" : "") + @invite_link = "#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : "") end def allow_embedding