Skip to content

Commit 4257817

Browse files
authored
Merge pull request #5 from leaonline/fix-urlsearchparams
Fix URLSearchParams (and tests)
2 parents 39505b1 + f23c62f commit 4257817

22 files changed

+1285
-627
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ jobs:
5656
run: |
5757
cd test-proxy
5858
meteor npm install
59+
meteor npm run setup
5960
meteor npm run lint
6061
meteor npm run test

HISTORY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# History
22

3+
## 4.2.1
4+
- this is a patch release, fixing a syntax error
5+
(that never got picked up, due to wrong linter config)
6+
7+
### Code fixes
8+
9+
- fix(core): standard lint fixed
10+
- fix(core): oauth.js fix wrong syntax error in import
11+
12+
### Dev fixes
13+
14+
- fix(ci): run npm setup before lint and test to link package
15+
- fix(build): remove .coverage from git
16+
(URLSearchParam missing s at the end)
17+
- fix(tests): test project linter settings fixed
18+
- fix(ci): remove dependencies from single job
19+
- update(ci): test workflow update to use test project
20+
21+
322
## 4.2.0
423
- updated `@node-oauth/oauth2-server` to `4.2.0`
524
- correctly setup coverage for test project and package

lib/model/meteor-model.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const collections = {
88
AuthCodes: undefined
99
}
1010

11-
1211
/**
1312
* @private used by OAuthMeteorModel.prototype.getAccessToken
1413
*/

lib/oauth.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { OptionsSchema } from './validation/OptionsSchema'
2323
import { app } from './webapp'
2424
import { errorHandler } from './utils/error'
2525
import { Random } from 'meteor/random'
26-
import { URLSearchParam } from 'url'
26+
import { URLSearchParams } from 'url'
2727
import { secureHandler } from './middleware/secureHandler'
2828

2929
// oauth
@@ -259,7 +259,8 @@ const initRoutes = (self, { accessTokenUrl = '/oauth/token', authorizeUrl = '/oa
259259
const that = this
260260
try {
261261
handler.call(that, req, res, next)
262-
} catch (unknownException) {
262+
}
263+
catch (unknownException) {
263264
const state = req && req.query && req.query.state
264265
errorHandler(res, {
265266
error: 'server_error',
@@ -349,7 +350,8 @@ const initRoutes = (self, { accessTokenUrl = '/oauth/token', authorizeUrl = '/oa
349350

350351
if (req.body.allowed === 'false') {
351352
Meteor.users.update(id, { $pull: { 'oauth.authorizedClients': client.clientId } })
352-
} else {
353+
}
354+
else {
353355
Meteor.users.update(id, { $addToSet: { 'oauth.authorizedClients': client.clientId } })
354356
}
355357

@@ -452,4 +454,4 @@ const initRoutes = (self, { accessTokenUrl = '/oauth/token', authorizeUrl = '/oa
452454
debug: self.debug
453455
})
454456
})
455-
}
457+
}

lib/utils/bind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meteor } from "meteor/meteor"
1+
import { Meteor } from 'meteor/meteor'
22

33
/**
44
* Binds a function to the Meteor environment and Fiber

lib/utils/console.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const name = `[OAuth2Server]`
1+
const name = '[OAuth2Server]'
22

33
const getHandler = type => {
44
const target = console[type]
@@ -15,4 +15,4 @@ const error = getHandler('error')
1515
* A wrapper for console-based logs
1616
* @type {{log: function, info: function, debug: function, warn: function, error: function}}
1717
*/
18-
export {log, info, debug, warn, error }
18+
export { log, info, debug, warn, error }

lib/validation/requiredAccessTokenPostParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Match } from "meteor/check"
1+
import { Match } from 'meteor/check'
22
import { nonEmptyString } from './nonEmptyString'
33

44
const isNonEmptyString = Match.Where(nonEmptyString)

lib/validation/requiredAuthorizeGetParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Match } from "meteor/check"
1+
import { Match } from 'meteor/check'
22
import { nonEmptyString } from './nonEmptyString'
33

44
const isNonEmptyString = Match.Where(nonEmptyString)

lib/validation/requiredAuthorizePostParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Match } from "meteor/check"
1+
import { Match } from 'meteor/check'
22
import { nonEmptyString } from './nonEmptyString'
33

44
const isNonEmptyString = Match.Where(nonEmptyString)

lib/validation/validateParams.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const validateParams = (actualParams, requiredParams, debug) => {
1010
try {
1111
check(actual, expected) // use console.log(requiredParamKey, actual, expected)
1212
return true
13-
} catch (e) {
13+
}
14+
catch (e) {
1415
if (debug) {
1516
console.error(`[validation error]: key <${requiredParamKey}> => expected <${expected}>, got <${actual}>`)
1617
}

0 commit comments

Comments
 (0)