We've moved discussions to Discord

Sign out doesn't remove tenant from url

Matt Bjornson
I'm in the process of merging the updates with multi tenancy into my app. I noticed when a user signs out, the tenant remains in the url.
Steps I'm taking:
  • Switch to (non-personal) account/tenant.
  • Click signout which redirects to the main landing page
  • I click on one of the links in the nav bar, I noticed it on the pricing page
  • in the browser I see http://localhost:5000/3/pricing

Anyone else experiencing this? I'm using the :account_id multi tenancy setting in jumpstart config.
Roberto Plancarte
Yes, also If you try to change teams sometimes you'll get the subdomain twice in the url. There isn't any uniqueness check on subdomain either so if two accounts use the same subdomain and switch teams you can sign into another account. 
Matt Bjornson
Roberto Plancarte  I'm not suing the subdomain in the url in my multitenancy config, so I'm not seeing that. I haven't tested with multiple users on the same tenant and report back.
Matt Bjornson
Roberto Plancarte Ok, I'm also seeing this behavior....

  • I log, I modified to send user to non-personal account/tenant ( :account_id = 3)
  • I click signout, which redirects to localhost:5000/3
  • I manually change the '3' to '2' in the browser address bar
  • I log in ( with the same user) which default sends me to the non-personal tenant
  • My browser url says https://localhost:5000/2 but my account 'avatar' shows that I'm in tenant with account_id 3

I tried adding this to application_controller.rb
class ApplicationController < ActionController::Base
...
  protected
  def after_sign_out_path_for(resource_or_scope)
    current_account = nil
    root_url
  end
end

This did not eliminate the :account_id in the url.
Matt Bjornson
Roberto Plancarte here's what I did... in views/shared/_navbar.html.erb, I updated the signout link to be
<%= link_to 'Sign out', destroy_user_session_path(script_name: '/', method: :delete, class:'css goes here', id: 'signout %>
Notifications
You’re not receiving notifications from this thread.