Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Merge dfb32e0 into 21ef582
Browse files Browse the repository at this point in the history
  • Loading branch information
vbalazs committed Sep 10, 2014
2 parents 21ef582 + dfb32e0 commit 3c087d7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/casino/application.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
// Place all the behaviors and hooks related to the matching controller here.
(function(win) {
if(!win.CASino) {
win.CASino = { baseUrl: '/' };
}

win.CASino.url = function(path) {
return win.CASino.baseUrl + path;
}
})(this);
3 changes: 1 addition & 2 deletions app/assets/javascripts/casino/sessions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function(win, doc) {
var url = '/login',
var url = win.CASino.url('login'),
cookie_regex = /(^|;)\s*tgt=/,
ready_bound = false;

Expand All @@ -8,7 +8,6 @@
service = serviceEl ? serviceEl.getAttribute('value') : null;

if(cookie_regex.test(doc.cookie)) {
url = '/login';
if(service) {
url += '?service=' + encodeURIComponent(service);
}
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title><%= CASino.config.frontend[:sso_name] %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_tag "window.CASino = { baseUrl: '#{root_path}' };" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= favicon_link_tag 'favicon.png', type: 'image/png' %>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
end
end

root to: redirect('/login')
root to: redirect('login')

# The priority is based upon order of creation:
# first created -> highest priority.
Expand Down

0 comments on commit 3c087d7

Please sign in to comment.