@feathersjs/authentication-oauth
Advanced tools
Comparing version 5.0.8 to 5.0.9
@@ -6,10 +6,12 @@ # Change Log | ||
## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) | ||
## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) | ||
**Note:** Version bump only for package @feathersjs/authentication-oauth | ||
### Bug Fixes | ||
- **authentication-oauth:** Properly handle all oAuth errors ([#3284](https://github.com/feathersjs/feathers/issues/3284)) ([148a9a3](https://github.com/feathersjs/feathers/commit/148a9a319b8e29138fda82d6c03bb489a7b4a6e1)) | ||
## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) | ||
**Note:** Version bump only for package @feathersjs/authentication-oauth | ||
## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) | ||
@@ -19,6 +21,2 @@ | ||
## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) | ||
@@ -25,0 +23,0 @@ |
@@ -18,4 +18,4 @@ import { HookContext, NextFunction, Params } from '@feathersjs/feathers'; | ||
export declare class OAuthError extends FeathersError { | ||
location: string; | ||
constructor(message: string, data: any, location: string); | ||
location?: string; | ||
constructor(message: string, data: any, location?: string); | ||
} | ||
@@ -22,0 +22,0 @@ export declare const redirectHook: () => (context: HookContext, next: NextFunction) => Promise<void>; |
@@ -92,2 +92,5 @@ "use strict"; | ||
}; | ||
if (payload.error) { | ||
throw new OAuthError(payload.error_description || payload.error, payload); | ||
} | ||
try { | ||
@@ -94,0 +97,0 @@ debug(`Calling ${authService}.create authentication with strategy ${name}`); |
{ | ||
"name": "@feathersjs/authentication-oauth", | ||
"description": "oAuth 1 and 2 authentication for Feathers. Powered by Grant.", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"homepage": "https://feathersjs.com", | ||
@@ -57,9 +57,9 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/authentication": "^5.0.8", | ||
"@feathersjs/commons": "^5.0.8", | ||
"@feathersjs/errors": "^5.0.8", | ||
"@feathersjs/express": "^5.0.8", | ||
"@feathersjs/feathers": "^5.0.8", | ||
"@feathersjs/koa": "^5.0.8", | ||
"@feathersjs/schema": "^5.0.8", | ||
"@feathersjs/authentication": "^5.0.9", | ||
"@feathersjs/commons": "^5.0.9", | ||
"@feathersjs/errors": "^5.0.9", | ||
"@feathersjs/express": "^5.0.9", | ||
"@feathersjs/feathers": "^5.0.9", | ||
"@feathersjs/koa": "^5.0.9", | ||
"@feathersjs/schema": "^5.0.9", | ||
"cookie-session": "^2.0.0", | ||
@@ -72,11 +72,11 @@ "grant": "^5.4.21", | ||
"devDependencies": { | ||
"@feathersjs/memory": "^5.0.8", | ||
"@types/cookie-session": "^2.0.44", | ||
"@types/express": "^4.17.17", | ||
"@types/koa-session": "^6.4.1", | ||
"@types/lodash": "^4.14.195", | ||
"@feathersjs/memory": "^5.0.9", | ||
"@types/cookie-session": "^2.0.45", | ||
"@types/express": "^4.17.18", | ||
"@types/koa-session": "^6.4.2", | ||
"@types/lodash": "^4.14.199", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^20.4.2", | ||
"@types/tough-cookie": "^4.0.2", | ||
"axios": "^1.4.0", | ||
"@types/node": "^20.7.0", | ||
"@types/tough-cookie": "^4.0.3", | ||
"axios": "^1.5.0", | ||
"mocha": "^10.2.0", | ||
@@ -86,5 +86,5 @@ "shx": "^0.3.4", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.1.6" | ||
"typescript": "^5.2.2" | ||
}, | ||
"gitHead": "414336a047a556f1986b4bb253416d5b8a973d9f" | ||
"gitHead": "64ee98dadf02dac34f31e3cb7b6b10e1f7405bfa" | ||
} |
@@ -31,3 +31,3 @@ import { createDebug } from '@feathersjs/commons' | ||
data: any, | ||
public location: string | ||
public location?: string | ||
) { | ||
@@ -118,2 +118,3 @@ super(message, 'NotAuthenticated', 401, 'not-authenticated', data) | ||
} | ||
const payload = grant?.response || result?.session?.response || result?.state?.response || params.query | ||
@@ -125,2 +126,6 @@ const authentication = { | ||
if (payload.error) { | ||
throw new OAuthError(payload.error_description || payload.error, payload) | ||
} | ||
try { | ||
@@ -127,0 +132,0 @@ debug(`Calling ${authService}.create authentication with strategy ${name}`) |
Sorry, the diff of this file is not supported yet
77137
920
Updated@feathersjs/commons@^5.0.9
Updated@feathersjs/errors@^5.0.9
Updated@feathersjs/express@^5.0.9
Updated@feathersjs/feathers@^5.0.9
Updated@feathersjs/koa@^5.0.9
Updated@feathersjs/schema@^5.0.9