-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 #24
base: master
Are you sure you want to change the base?
V2 #24
Conversation
- update tests
@@ -9,7 +9,7 @@ | |||
"author": "", | |||
"license": "ISC", | |||
"dependencies": { | |||
"@digipolis/auth": "^1.1.0", | |||
"@digipolis/auth": "git+https://github.com/digipolisantwerp/auth_module_nodejs.git", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarom is dit niet de gepubliceerde versie?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omdat deze versie nog niet gepublished is.
```js | ||
app.use(require('@digipolis/auth')(app, configuration)); | ||
``` | ||
You should use `express-session` in your application to enable session storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misschien handig om achter express-session
een linkje te leggen naar de juiste module:
https://www.npmjs.com/package/express-session
src/controller.js
Outdated
} | ||
|
||
function logout(req, res) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whiteline :-o
} | ||
|
||
async function refreshToken(req, res, next) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whiteline
]; | ||
|
||
function validateConfig(config) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whiteline
test/loginCallback.js
Outdated
}); | ||
|
||
res.on('end', () => { | ||
// assert(res.redirect.calledWith('/')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oeps?
test/sso.js
Outdated
|
||
|
||
describe('test sso middleware', function onDescribe() { | ||
// nockGetSession({ssoKey: 'fakessokey', payload: emptySessions}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mag weg.
@@ -6,6 +6,8 @@ services: | |||
environment: | |||
- PORT=2000 | |||
- MONGO_CONNECTIONSTRING=mongodb://mongo:27017/basic-mongo-auth | |||
- CLIENT_SECRET= | |||
- CLIENT_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misschien handig om in te vullen met dummy code?
Ik zou ook node v6 uit de test-builds halen en expliciet vermelden in de README dat we dit niet meer ondersteunen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only es module imports pls
src/controller.js
Outdated
} | ||
|
||
const newToken = await service.refresh(token); | ||
req.session = Object.assign(req.session, { [tokenKey]: newToken }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest operator can be used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maakt rest operator er geen nieuw object van, ik kopieer hier de property op de req.session
Misschien is de assignment dan niet echt nodig.
export function getHost(req) { | ||
return `${req.protocol}://${req.get('host')}` | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for new lines with eslint
test/isLoggedin.js
Outdated
const assert = require('assert'); | ||
const reqres = require('reqres'); | ||
const user = require('./mocks/user.json'); | ||
|
||
describe('test #isLoggedin', function onDescribe() { | ||
describe('GET /isLoggedin', function onDescribe() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowercase urls pls
@@ -9,7 +9,7 @@ let { | |||
auth: authConfig, | |||
mongoConnectionString, | |||
port = 2000 | |||
} = require('./config'); | |||
} = require('./old-config'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does te example use an old config ?
package.json
Outdated
"@babel/core": "^7.8.4", | ||
"@babel/preset-env": "^7.8.4", | ||
"@babel/register": "^7.8.3", | ||
"@istanbuljs/nyc-config-babel": "^3.0.0", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
"babel-plugin-istanbul": "^6.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to add babel to this?
I see a target to node 8 however i would tend to target the latest lts versions for new modules.
node 8 is passed its lifetime anyway.
* Use default authentication method in SSO redirect URL for low sessions * Fix typo in loop while searching for highest assurance level * Remove node 8 from travis config
…ation-method Fix naming of authentication method param during logout
Bug/acapp 434
chore/maintenance
…e-na-auth ASTAD-28445 Open redirect issue na auth
…e-na-auth ASTAD-28445 open redirect issue na auth
Add crash handler to failed refresh calls and additional error logging
No description provided.