working saml attributes
This commit is contained in:
parent
33865b9d02
commit
6a1c484356
2 changed files with 19 additions and 4 deletions
16
index.js
16
index.js
|
|
@ -23,11 +23,25 @@ app.use(express.json());
|
|||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
res.send('Hello World!<br><a href="/login">Login</a>');
|
||||
response = 'Hello World!<br>';
|
||||
console.log('User:', req.user);
|
||||
if (req.user) {
|
||||
console.log('User:', req.user);
|
||||
response += 'Username: ' + req.user.username + '<br>';
|
||||
response += 'First Name: ' + req.user.first_name + '<br>';
|
||||
response += 'Last Name: ' + req.user.last_name + '<br>';
|
||||
response += 'Org Unit: ' + req.user.org_unit + '<br>';
|
||||
response += '<a href="/logout">Logout</a>';
|
||||
}
|
||||
else {
|
||||
response += '<a href="/login">Login</a>';
|
||||
}
|
||||
res.send(response);
|
||||
});
|
||||
|
||||
app.get('/logout', function (req, res) {
|
||||
req.logout();
|
||||
res.redirect('/');
|
||||
});
|
||||
|
||||
app.get('/login',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue