diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index e78b87cc..cac3140b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -22,7 +22,7 @@ class SessionsController < ApplicationController def create @user = User.from_omniauth(request.env['omniauth.auth']) session[:user_id] = @user.id - redirect_to @user.room_url + redirect_to meeting_room_url(resource: 'rooms', id: @user.encrypted_id) rescue => e logger.error "Error authenticating via omniauth: #{e}" redirect_to root_path diff --git a/app/models/user.rb b/app/models/user.rb index f9a27a8d..34672309 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -43,10 +43,6 @@ class User < ApplicationRecord auth_hash['info']['email'] end - def room_url - "#{Rails.configuration.relative_url_root}/rooms/#{encrypted_id}" - end - def set_encrypted_id self.encrypted_id = "#{username[0..1]}-#{Digest::SHA1.hexdigest(uid+provider)[0..7]}" end diff --git a/app/views/shared/_signup.html.erb b/app/views/shared/_signup.html.erb index ec304f38..842960b0 100644 --- a/app/views/shared/_signup.html.erb +++ b/app/views/shared/_signup.html.erb @@ -17,9 +17,9 @@ <% if current_user %>
<% if @main_room %> - <%= t('logged_in_description_html', link: link_to(current_user.name, current_user.room_url)) %> + <%= t('logged_in_description_html', link: link_to(current_user.name, meeting_room_url(resource: 'rooms', id: current_user.encrypted_id))) %> <% else %> - <%= link_to(t('return_to_room'), current_user.room_url) %> + <%= link_to(t('return_to_room'), meeting_room_url(resource: 'rooms', id: current_user.encrypted_id)) %> <% end %>
<%= link_to t('logout'), user_logout_url %>