Skip to content

Commit b23f02d

Browse files
committed
update dev dependencies
1 parent 4a81cb0 commit b23f02d

File tree

4 files changed

+44
-31
lines changed

4 files changed

+44
-31
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: tests
55
# Controls when the action will run.
66
on:
77
push:
8-
branches: [ '*' ]
8+
branches: ['*']
99
pull_request:
10-
branches: [ '*' ]
10+
branches: ['*']
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -20,26 +20,26 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
node-version: [14, 16, 18]
24-
mongodb-version: [4.2, 4.4, 5.0]
23+
node-version: [18, 20, 22]
24+
mongodb-version: [5.0, 6.0, 7.0, 8.0]
2525

2626
# Steps represent a sequence of tasks that will be executed as part of the job
2727
steps:
28-
- name: Git checkout
29-
uses: actions/checkout@v2
28+
- name: Git checkout
29+
uses: actions/checkout@v4
3030

31-
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@v1
33-
with:
34-
node-version: ${{ matrix.node-version }}
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
3535

36-
- name: Start MongoDB
37-
uses: supercharge/mongodb-github-action@1.3.0
38-
with:
39-
mongodb-version: ${{ matrix.mongodb-version }}
36+
- name: Start MongoDB
37+
uses: supercharge/mongodb-github-action@1.11.0
38+
with:
39+
mongodb-version: ${{ matrix.mongodb-version }}
4040

41-
- run: npm install
41+
- run: npm install
4242

43-
- run: npm test
44-
env:
45-
CI: true
43+
- run: npm test
44+
env:
45+
CI: true

index.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ module.exports = {
3333
// that export a Strategy property, and directly passing in a strategy property
3434
// in the spec
3535
const strategyModule = spec.module && await self.apos.root.import(spec.module);
36-
const Strategy = strategyModule ? (strategyModule.Strategy || strategyModule) : spec.Strategy;
36+
const Strategy = strategyModule
37+
? (strategyModule.Strategy || strategyModule)
38+
: spec.Strategy;
3739
if (!Strategy) {
3840
throw new Error('@apostrophecms/passport-bridge: each strategy must have a "module" setting\n' +
3941
'giving the name of an npm module installed in your project that\n' +
@@ -111,10 +113,12 @@ module.exports = {
111113
return (absolute ? (self.apos.baseUrl + self.apos.prefix) : '') + '/auth/' + strategyName + '/connect/' + token;
112114
},
113115

114-
// Adds the login route, which will be `/auth/strategyname/login`, where the strategy name
116+
// Adds the login route
117+
// which will be `/auth/strategyname/login`, where the strategy name
115118
// depends on the passport module being used.
116119
//
117-
// Redirect users to this URL to start the process of logging them in via each strategy
120+
// Redirect users to this URL
121+
// to start the process of logging them in via each strategy
118122
addLoginRoute(spec) {
119123
self.apos.app.get(self.getLoginUrl(spec), (req, res, next) => {
120124
if (req.query.newLocale) {
@@ -208,7 +212,7 @@ module.exports = {
208212
self.apos.app.get(self.getFailureUrl(spec), function (req, res) {
209213
// Gets i18n'd in the template
210214
return self.sendPage(req, 'error', {
211-
spec: spec,
215+
spec,
212216
message: 'aposPassportBridge:rejected'
213217
});
214218
});
@@ -289,7 +293,12 @@ module.exports = {
289293
return callback(null, false);
290294
}
291295
try {
292-
const user = await self.apos.user.find(adminReq, criteria).toObject() || (self.options.create && !connectingUserId && await self.createUser(spec, profile));
296+
const user = await self.apos.user.find(adminReq, criteria).toObject() ||
297+
(
298+
self.options.create &&
299+
!connectingUserId &&
300+
await self.createUser(spec, profile)
301+
);
293302
// Legacy, incompatible with Passport 0.6
294303
if (self.options.retainAccessTokenInSession && user && req) {
295304
req.session.accessToken = accessToken;
@@ -473,7 +482,9 @@ module.exports = {
473482
}
474483
let route;
475484
if (doc) {
476-
const action = self.apos.page.isPage(doc) ? self.apos.page.action : self.apos.doc.getManager(doc).action;
485+
const action = self.apos.page.isPage(doc)
486+
? self.apos.page.action
487+
: self.apos.doc.getManager(doc).action;
477488
route = `${action}/${doc._id}/locale/${newLocale}`;
478489
} else {
479490
// Fall back to home page, with appropriate prefix

modules/@apostrophecms/user-passport-bridge/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ module.exports = {
7575
return await fn(accessToken);
7676
} catch (e) {
7777
if (e.status && e.status === 401) {
78-
const { accessToken } = await self.refreshTokens(user, strategy, refreshToken);
78+
const {
79+
accessToken
80+
} = await self.refreshTokens(user, strategy, refreshToken);
7981
// On the second try, failure is failure
8082
// We don't need "await" because we are already returning
8183
// a promise

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
"author": "Apostrophe Technologies",
1717
"license": "MIT",
1818
"devDependencies": {
19-
"eslint": "^7.9.0",
20-
"eslint-config-apostrophe": "^3.4.0",
21-
"eslint-config-standard": "^14.1.1",
19+
"eslint": "^8.57.1",
20+
"eslint-config-apostrophe": "^4.3.0",
21+
"eslint-config-standard": "^17.1.0",
2222
"eslint-plugin-import": "^2.22.0",
2323
"eslint-plugin-node": "^11.1.0",
24-
"eslint-plugin-promise": "^4.2.1",
24+
"eslint-plugin-promise": "^6.6.0",
2525
"eslint-plugin-standard": "^4.0.1",
26-
"stylelint": "^13.7.1",
27-
"stylelint-config-apostrophe": "^1.0.0"
26+
"stylelint": "^16.9.0",
27+
"stylelint-config-apostrophe": "^4.1.0"
2828
},
2929
"dependencies": {
3030
"humanname": "^0.2.2",

0 commit comments

Comments
 (0)