Fix up CI
This commit is contained in:
Родитель
9f73dc1746
Коммит
475eb765ec
26
.eslintrc
26
.eslintrc
|
@ -1,12 +1,14 @@
|
|||
{
|
||||
"extends": "fxa/server",
|
||||
"ecmaFeatures": {
|
||||
"modules": true
|
||||
},
|
||||
"rules": {
|
||||
"semi": 0
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
plugins:
|
||||
- fxa
|
||||
|
||||
extends: plugin:fxa/server
|
||||
|
||||
rules:
|
||||
handle-callback-err: 0
|
||||
prefer-const: 0
|
||||
strict: 0
|
||||
semi: [2, "always"]
|
||||
indent: [0, 2]
|
||||
|
||||
parserOptions:
|
||||
ecmaVersion: 2018
|
||||
|
|
|
@ -24,7 +24,7 @@ var DIFFERENT_BROWSER_ERROR = 3005;
|
|||
* OAuth Login, redirects to FxA
|
||||
*/
|
||||
router.get('/login', function(req, res) {
|
||||
var nonce = crypto.randomBytes(32).toString('hex');
|
||||
var nonce = crypto.randomBytes(32).toString('hex'); // eslint-disable-line
|
||||
oauthFlows[nonce] = true;
|
||||
req.session.state = nonce;
|
||||
return res.redirect(redirectUrl('signin', nonce));
|
||||
|
@ -149,13 +149,13 @@ router.get('/redirect', function(req, res) {
|
|||
return res.redirect(baseUrl);
|
||||
} else {
|
||||
var msg = 'Bad request ';
|
||||
if (!code) {
|
||||
if (! code) {
|
||||
msg += ' - missing code';
|
||||
}
|
||||
|
||||
if (!state) {
|
||||
if (! state) {
|
||||
msg += ' - missing state';
|
||||
} else if (!oauthFlows[state]) {
|
||||
} else if (! oauthFlows[state]) {
|
||||
msg += ' - unknown state';
|
||||
} else if (state !== req.session.state) {
|
||||
msg += " - state cookie doesn't match";
|
||||
|
|
|
@ -42,7 +42,7 @@ function getCommitHashFromVersionJson() {
|
|||
}
|
||||
|
||||
function getGitDir() {
|
||||
if (!fs.existsSync(path.join(__dirname, '..', '..', '.git'))) {
|
||||
if (! fs.existsSync(path.join(__dirname, '..', '..', '.git'))) {
|
||||
// try at '/home/app/git' for AwsBox deploys
|
||||
return path.sep + path.join('home', 'app', 'git');
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ var conf = require('./config');
|
|||
var baseUrl = conf.get('base_url');
|
||||
var sessionSecret = conf.get('server').session;
|
||||
|
||||
if (!sessionSecret) {
|
||||
if (! sessionSecret) {
|
||||
throw new Error('Session secret not configured.');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче