aboutsummaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-05-06 21:07:24 +0200
committerMateja <mail@matejamaric.com>2021-05-06 21:07:24 +0200
commit376fae2a3367d5813d088a29c5a62938bd55f762 (patch)
tree3812cbf552d90024550cc2e88e0ba2cf4927f191 /controllers
parente0f29f19df909b7a49ac693d82ba5ff085d079a2 (diff)
downloadnode-playground-376fae2a3367d5813d088a29c5a62938bd55f762.tar.gz
node-playground-376fae2a3367d5813d088a29c5a62938bd55f762.zip
Boilerplate for login system.
Diffstat (limited to 'controllers')
-rw-r--r--controllers/user.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/controllers/user.js b/controllers/user.js
new file mode 100644
index 0000000..e25abf8
--- /dev/null
+++ b/controllers/user.js
@@ -0,0 +1,25 @@
+module.exports = {
+
+ register(req, res) {
+ console.log(req.body);
+ res.redirect('/register');
+ },
+
+ login(req, res) {
+ console.log(req.body);
+ res.redirect('/login');
+ },
+
+ logout(req, res) {
+ res.redirect('/');
+ },
+
+ registerView(req, res) {
+ res.render('register', {title: 'Register', register: true});
+ },
+
+ loginView(req, res) {
+ res.render('login', {title: 'Login', login: true});
+ }
+
+};