Revision acb284f7
b/snf-cyclades-app/synnefo/ui/static/snf/js/auth.js | ||
---|---|---|
67 | 67 |
this.config = $.extend(this.default_config, config); |
68 | 68 |
this.current_token = undefined; |
69 | 69 |
this.current_username = undefined; |
70 |
this.skip_redirects = config.skip_redirects === undefined ? false : |
|
71 |
config.skip_redirects; |
|
70 | 72 |
|
71 | 73 |
var self = this; |
72 | 74 |
this.updater = window.setInterval(function(){ |
... | ... | |
85 | 87 |
} |
86 | 88 |
|
87 | 89 |
snf.auth.AstakosClient.prototype.delete_cookie = function() { |
90 |
if (!this.skip_redirects) { |
|
88 | 91 |
$.cookie(this.config.cookie_name, null); |
92 |
} |
|
89 | 93 |
} |
90 | 94 |
|
91 | 95 |
snf.auth.AstakosClient.prototype.redirect_to_logout = function() { |
96 |
if (!this.skip_redirects) { |
|
92 | 97 |
window.location = this.config.logout_url + "?next="; |
98 |
} |
|
93 | 99 |
} |
94 | 100 |
|
95 | 101 |
snf.auth.AstakosClient.prototype.redirect_to_login = function() { |
102 |
if (!this.skip_redirects) { |
|
96 | 103 |
window.location = this.config.login_url + "?next=" + window.location.toString(); |
104 |
} |
|
97 | 105 |
} |
98 | 106 |
|
99 | 107 |
// delete cookie and redirect to logout |
b/snf-cyclades-app/synnefo/ui/templates/home.html | ||
---|---|---|
658 | 658 |
login_url: synnefo.config.login_redirect, |
659 | 659 |
logout_url: synnefo.config.logout_redirect, |
660 | 660 |
cookie_name: synnefo.config.auth_cookie_name, |
661 |
skip_redirects: {{ auth_skip_redirects|safe }}, |
|
661 | 662 |
logout_callback: function(client) { |
662 | 663 |
Backbone.history.navigate(client.config.logout_url); |
663 | 664 |
window.location = client.config.logout_url; |
b/snf-cyclades-app/synnefo/ui/views.py | ||
---|---|---|
89 | 89 |
|
90 | 90 |
AUTH_COOKIE_NAME = getattr(settings, "UI_AUTH_COOKIE_NAME", 'synnefo_user') |
91 | 91 |
|
92 |
# never change window location. Helpful in development environments |
|
93 |
AUTH_SKIP_REDIRECTS = getattr(settings, "UI_AUTH_SKIP_REDIRECTS", False) |
|
94 |
|
|
92 | 95 |
# UI behaviour settings |
93 | 96 |
DELAY_ON_BLUR = getattr(settings, "UI_DELAY_ON_BLUR", True) |
94 | 97 |
UPDATE_HIDDEN_VIEWS = getattr(settings, "UI_UPDATE_HIDDEN_VIEWS", False) |
... | ... | |
204 | 207 |
'changes_since_alignment': CHANGES_SINCE_ALIGNMENT, |
205 | 208 |
'image_icons': IMAGE_ICONS, |
206 | 209 |
'auth_cookie_name': AUTH_COOKIE_NAME, |
210 |
'auth_skip_redirects': json.dumps(AUTH_SKIP_REDIRECTS), |
|
207 | 211 |
'suggested_flavors': json.dumps(SUGGESTED_FLAVORS), |
208 | 212 |
'suggested_roles': json.dumps(SUGGESTED_ROLES), |
209 | 213 |
'vm_image_common_metadata': json.dumps(VM_IMAGE_COMMON_METADATA), |
Also available in: Unified diff