kaui 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c4c83530dabc57b1b0441fdac6761621d8c06ac
|
4
|
+
data.tar.gz: b50be017d6fa75203ef48637b7a5a67cc6d77207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ac3e544f3499cb230eb9c5db0ef745567694ab2958556e498f25efc2f83c750022b05ba03c8289cea1c676c69d9256f9dbd262a8fe264a168e00498f7ac33a3
|
7
|
+
data.tar.gz: 5efc247745b46113471e1acc3522979199f07dda37caac949108de7ed5ed606dc14d1d4347426a728eb68840ef89d42b2bc922086ab01b0ee55fea2a7f45c285
|
data/Gemfile.lock
CHANGED
@@ -23,11 +23,12 @@ module Kaui
|
|
23
23
|
tenant = KillBillClient::Model::Tenant.find_by_api_key(KillBillClient.api_key, {
|
24
24
|
:session_id => user.kb_session_id
|
25
25
|
})
|
26
|
-
|
27
|
-
|
26
|
+
if tenant.present?
|
27
|
+
select_tenant_for_tenant_id(tenant.tenant_id, tenant.external_key)
|
28
|
+
end
|
28
29
|
when 1
|
29
30
|
# If there is only one tenant defined we skip the screen and set the tenant for the user
|
30
|
-
select_tenant_for_tenant_id(@tenants[0].kb_tenant_id)
|
31
|
+
select_tenant_for_tenant_id(@tenants[0].kb_tenant_id, @tenants[0].name)
|
31
32
|
else
|
32
33
|
# Jump to default view allowing to chose which tenant to pick
|
33
34
|
respond_to do |format|
|
@@ -45,14 +46,16 @@ module Kaui
|
|
45
46
|
|
46
47
|
def select_tenant
|
47
48
|
kb_tenant_id = params[:kb_tenant_id]
|
48
|
-
|
49
|
+
tenant = Kaui::Tenant.find_by_kb_tenant_id(kb_tenant_id)
|
50
|
+
select_tenant_for_tenant_id(tenant.kb_tenant_id, tenant.name)
|
49
51
|
end
|
50
52
|
|
51
53
|
private
|
52
54
|
|
53
|
-
def select_tenant_for_tenant_id(kb_tenant_id)
|
55
|
+
def select_tenant_for_tenant_id(kb_tenant_id, kb_tenant_name_or_key)
|
54
56
|
# Set kb_tenant_id in the session
|
55
57
|
session[:kb_tenant_id] = kb_tenant_id
|
58
|
+
session[:kb_tenant_name] = kb_tenant_name_or_key
|
56
59
|
redirect_to Kaui.home_path.call
|
57
60
|
end
|
58
61
|
|
@@ -22,7 +22,11 @@
|
|
22
22
|
</ul>
|
23
23
|
<ul class="nav pull-right">
|
24
24
|
<% if user_signed_in? -%>
|
25
|
-
|
25
|
+
<% if session[:kb_tenant_name].present? %>
|
26
|
+
<li><%= link_to "Sign out [tenant: #{session[:kb_tenant_name]}]", destroy_user_session_path, method: :delete %></li>
|
27
|
+
<% else %>
|
28
|
+
<li><%= link_to 'Sign out', destroy_user_session_path, method: :delete %></li>
|
29
|
+
<% end %>
|
26
30
|
<% end -%>
|
27
31
|
</ul>
|
28
32
|
</div>
|
data/lib/kaui/version.rb
CHANGED