Skip to content

Commit

Permalink
Adjust introspect API.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Jun 21, 2024
1 parent 8a5332d commit 54161eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/service/api/oauth/introspect.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from "express";

import { errorMessages, statusCodes } from "../../../utils/http-status.js";
import { ErrorResponse, SuccessResponse } from "../../../utils/response.js";
import { statusCodes } from "../../../utils/http-status.js";
import { SuccessResponse } from "../../../utils/response.js";
import OAuthModel from "../../../model/oauth/oauth.js";
import { ScopeManager } from "../../../singleton/scope-manager.js";
import { UserProjection } from "../../../model/mongo/user.js";
Expand All @@ -22,7 +22,7 @@ const ALL_Introspect = async (req: Request, res: Response) => {
});
}
if (errors.length) {
return res.status(statusCodes.forbidden).json(new ErrorResponse(errorMessages.forbidden, { errors }));
return res.status(statusCodes.success).json(new SuccessResponse({ tokenInfo: null }));
}
const token = req.query.token || req.body.token;
const tokenInfo = await OAuthModel.getAccessToken(token);
Expand Down

0 comments on commit 54161eb

Please sign in to comment.