Skip to content

Commit

Permalink
Fix return type of register function
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Apr 14, 2022
1 parent f56e822 commit 49bcb05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oauth-dyn-reg",
"version": "2.1.0",
"version": "2.1.1",
"description": "Implementation of draft OAuth 2.0 Dynamic Client Registration Protocol",
"main": "dist/index.js",
"engines": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import request, { HTTPError, ResponseError } from 'superagent';

import type Metadata from '@oada/types/oauth-dyn-reg/metadata.js';
import type RegistrationData from '@oada/types/oauth-dyn-reg/response.js';

export class ClientRegistrationError extends Error {
readonly response;
Expand Down Expand Up @@ -75,7 +76,7 @@ export default async function register(

try {
const resp = await registration;
return resp?.body as Metadata;
return resp?.body as RegistrationData;
} catch (error: unknown) {
// Handle registration errors as defined in RFC
if (isResponseError(error)) {
Expand Down

0 comments on commit 49bcb05

Please sign in to comment.