szurubooru/static/js/controllers/auth_controller.js
rr- 797ace982f start
Done so far

Basic backend skeleton

- technology choices
- database migration outline
- basic self hosting facade
- basic REST outline
- proof of concept for auth and privileges

Basic frontend skeleton

- technology choices
- pretty robust frontend compilation
- top navigation
- proof of concept for registration form
2016-03-27 23:05:10 +02:00

34 lines
620 B
JavaScript

'use strict';
class AuthController {
constructor(topNavigationController) {
this.topNavigationController = topNavigationController;
this.currentUser = null;
}
isLoggedIn() {
return this.currentUser !== null;
}
hasPrivilege() {
return true;
}
login(user) {
this.currentUser = user;
}
logout(user) {
this.currentUser = null;
}
loginRoute() {
this.topNavigationController.activate('login');
}
logoutRoute() {
this.topNavigationController.activate('logout');
}
}
module.exports = AuthController;