@mantiq/oauth 0.5.22 → 0.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/errors/OAuthError.ts +5 -2
package/package.json
CHANGED
package/src/errors/OAuthError.ts
CHANGED
|
@@ -3,14 +3,17 @@ import { HttpError } from '@mantiq/core'
|
|
|
3
3
|
/**
|
|
4
4
|
* OAuth-specific error.
|
|
5
5
|
* Defaults to 400 Bad Request. Use a different status code for specific cases.
|
|
6
|
+
*
|
|
7
|
+
* The `errorCode` property carries the OAuth2 error code
|
|
8
|
+
* (e.g. 'invalid_request', 'invalid_grant') as defined by RFC 6749.
|
|
6
9
|
*/
|
|
7
10
|
export class OAuthError extends HttpError {
|
|
8
11
|
constructor(
|
|
9
12
|
message: string,
|
|
10
|
-
|
|
13
|
+
oauthCode: string = 'invalid_request',
|
|
11
14
|
statusCode = 400,
|
|
12
15
|
) {
|
|
13
|
-
super(statusCode, message)
|
|
16
|
+
super(statusCode, message, undefined, undefined, oauthCode)
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
toJSON(): Record<string, any> {
|