File size: 444 Bytes
b39afbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Copyright (c) 2023 MERCENARIES.AI PTE. LTD.
 * All rights reserved.
 */

const script = {
  name: 'setKey',

  exec: async function (ctx, payload) {
    const [apiNamespace, tokenType, secret] = payload
    const credentialService = ctx.app.services.get('credentials')
    const response = await credentialService.setUserCredential(ctx.user, apiNamespace, tokenType, secret)
    return { answer: response }
  }

}

export default script