5 Commits

Author SHA1 Message Date
f20a8327af 3.4.1 2019-09-01 17:05:42 +02:00
571de43aa8 Merge pull request #47 from 67P/chore/fix_warnings
Fix warnings from express session
2019-09-01 17:05:22 +02:00
50002194c5 Fix warnings from express session 2019-09-01 17:04:19 +02:00
cecc632620 Merge pull request #46 from 67P/bugfix/signup_issue
Fix critical bug in signup code
2019-09-01 17:03:06 +02:00
6972d6c88e Fix critical bug in signup code
Variable scope/assignment issue
2019-09-01 17:00:56 +02:00
3 changed files with 10 additions and 4 deletions

View File

@@ -197,7 +197,12 @@ module.exports = async function(robot, kredits) {
}
};
robot.router.use(session({ secret: process.env.KREDITS_SESSION_SECRET || 'grant' }));
robot.router.use(session({
secret: process.env.KREDITS_SESSION_SECRET || 'grant',
resave: false,
saveUninitialized: false
}));
robot.router.use('/kredits/signup', grant(grantConfig));
robot.router.get('/kredits/signup/github', async (req, res) => {
@@ -214,8 +219,9 @@ module.exports = async function(robot, kredits) {
res.status(400).json({});
return;
}
let githubResponse;
try {
const githubResponse = await fetch('https://api.github.com/user', {
githubResponse = await fetch('https://api.github.com/user', {
headers: {
'Accept': 'application/vnd.github.v3+json',
'Authorization': `token ${accessToken}`

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "hubot-kredits",
"version": "3.4.0",
"version": "3.4.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "hubot-kredits",
"version": "3.4.0",
"version": "3.4.1",
"description": "Kosmos Kredits functionality for chat bots",
"main": "index.js",
"scripts": {