|
@@ -18,7 +18,7 @@ app.get('/', function(req, res, next) {
|
18
|
18
|
});
|
19
|
19
|
|
20
|
20
|
app.post('/', function(req, res, next) {
|
21
|
|
- var identifier = req.body.username;
|
|
21
|
+ var identifier = req.body.first+';'+req.body.last;
|
22
|
22
|
|
23
|
23
|
var m = new MacaroonsBuilder(location, secretKey, identifier)
|
24
|
24
|
.add_first_party_caveat("status = student")
|
|
@@ -26,7 +26,7 @@ app.post('/', function(req, res, next) {
|
26
|
26
|
|
27
|
27
|
res.cookie('das-macaroon', m.serialize());
|
28
|
28
|
|
29
|
|
- res.send('Logged in as ' + req.body.username + ' (student)');
|
|
29
|
+ res.send('Logged in as ' + req.body.first + ' ' + req.body.last + ' (student)');
|
30
|
30
|
});
|
31
|
31
|
|
32
|
32
|
app.get('/teacher', function(req, res, next) {
|
|
@@ -34,7 +34,7 @@ app.get('/teacher', function(req, res, next) {
|
34
|
34
|
});
|
35
|
35
|
|
36
|
36
|
app.post('/teacher', function(req, res, next) {
|
37
|
|
- var identifier = req.body.username;
|
|
37
|
+ var identifier = req.body.first+';'+req.body.last;
|
38
|
38
|
|
39
|
39
|
var m = new MacaroonsBuilder(location, secretKey, identifier)
|
40
|
40
|
.add_first_party_caveat("status = teacher")
|
|
@@ -42,7 +42,7 @@ app.post('/teacher', function(req, res, next) {
|
42
|
42
|
|
43
|
43
|
res.cookie('das-macaroon', m.serialize());
|
44
|
44
|
|
45
|
|
- res.send('Logged in as ' + req.body.username + ' (teacher)');
|
|
45
|
+ res.send('Logged in as ' + req.body.first + ' ' + req.body.last + ' (teacher)');
|
46
|
46
|
});
|
47
|
47
|
|
48
|
48
|
app.listen(1337, function() {
|