summaryrefslogtreecommitdiff
path: root/www/js/auth.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-04-20 16:51:41 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-04-20 16:51:41 (GMT)
commitee11338a3399a3eb56fa371389218c81ac746058 (patch)
tree7807603384ce1288151bb226b1c5d49c957a7bcf /www/js/auth.js
parent16b507e9ab3b7d9bfbe72319d2197cea98905294 (diff)
replace apps with router
Diffstat (limited to 'www/js/auth.js')
-rw-r--r--www/js/auth.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/www/js/auth.js b/www/js/auth.js
index c533219..3931022 100644
--- a/www/js/auth.js
+++ b/www/js/auth.js
@@ -25,19 +25,16 @@
var Rdxport = Rdxport || {};
Rdxport.Auth = function() {
- console.log('auth');
this.username = sessionStorage.getItem('auth_username');
this.fullname = sessionStorage.getItem('auth_fullname');
this.token = sessionStorage.getItem('auth_token');
};
Rdxport.Auth.prototype.isLoggedIn = function() {
- console.log('isLoggedIn');
return this.username && this.fullname && this.token;
};
Rdxport.Auth.prototype.set = function(username, fullname, token) {
- console.log('set');
this.username = username;
this.fullname = fullname;
this.token = token;
@@ -48,7 +45,6 @@ Rdxport.Auth.prototype.set = function(username, fullname, token) {
};
Rdxport.Auth.prototype.cleanup = function() {
- console.log('cleanup');
sessionStorage.removeItem('auth_username');
sessionStorage.removeItem('auth_fullname');
sessionStorage.removeItem('auth_token');
@@ -59,7 +55,6 @@ Rdxport.Auth.prototype.cleanup = function() {
};
Rdxport.AuthView = function(model) {
- console.log('AuthView');
this.model = model;
};
@@ -69,7 +64,7 @@ Rdxport.AuthView.prototype.renderLoggedIn = function() {
$('#username-field').html(this.model.fullname + ' (' + this.model.username + ')');
$('button.logout').off().on('click', function() {
- router.logout();
+ router.route('logout');
});
};