797ace982f
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
34 lines
620 B
JavaScript
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;
|