Skip to content

Commit

Permalink
chore: several config fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jul 25, 2023
1 parent 391dc12 commit b8b0cfd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/w3c-vc-api/src/api-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { checkAuth, ISingleEndpointOpts, sendErrorResponse } from '@sphereon/ssi
import { CredentialPayload } from '@veramo/core'
import { W3CVerifiableCredential } from '@veramo/core/src/types/vc-data-model'
import { Request, Response, Router } from 'express'
import passport from 'passport'
import { v4 } from 'uuid'
import { IIssueCredentialEndpointOpts, IRequiredContext, IVCAPIIssueOpts, IVerifyCredentialEndpointOpts } from './types'

Expand All @@ -14,7 +13,7 @@ export function issueCredentialEndpoint(router: Router, context: IRequiredContex
}
const path = opts?.path ?? '/credentials/issue'

router.post(path, passport.authenticate('oauth-bearer'), checkAuth(opts?.endpoint), async (request: Request, response: Response) => {
router.post(path, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {
try {
const credential: CredentialPayload = request.body.credential
if (!credential) {
Expand Down Expand Up @@ -110,7 +109,7 @@ export function deleteCredentialEndpoint(router: Router, context: IRequiredConte
console.log(`Delete credential endpoint is disabled`)
return
}
router.delete(opts?.path ?? '/credentials/:id', async (request: Request, response: Response) => {
router.delete(opts?.path ?? '/credentials/:id', checkAuth(opts?.endpoint), async (request: Request, response: Response) => {
try {
const id = request.params.id
if (!id) {
Expand Down

0 comments on commit b8b0cfd

Please sign in to comment.