Skip to content

Commit

Permalink
add current user info to /api/status page
Browse files Browse the repository at this point in the history
  • Loading branch information
simonredfern committed Dec 9, 2024
1 parent ef8d637 commit 779812a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/controllers/CallbackController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import OauthAccessTokenMiddleware from '../middlewares/OauthAccessTokenMiddlewar
@Service()
@Controller()
@UseBefore(OauthAccessTokenMiddleware)
// This controller seems to not do anything at all
export default class CallbackController {
@Get('/callback')
callback(@Req() request: Request, @Res() response: Response): Response {
Expand Down
4 changes: 3 additions & 1 deletion server/controllers/StatusController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ export class StatusController {
): Response {
const oauthConfig = session['clientConfig']
const version = this.obpClientService.getOBPVersion()
const currentUser = await this.obpClientService.get(`/obp/${version}/users/current`, oauthConfig)
const apiVersions = await this.checkApiVersions(oauthConfig, version)
const messageDocs = await this.checkMessagDocs(oauthConfig, version)
const resourceDocs = await this.checkResourceDocs(oauthConfig, version)
return response.json({
status: apiVersions && messageDocs && resourceDocs,
apiVersions,
messageDocs,
resourceDocs
resourceDocs,
currentUser
})
}

Expand Down

0 comments on commit 779812a

Please sign in to comment.