MCPcopy
hub / github.com/chartbrew/chartbrew / createApiKey

Method createApiKey

server/controllers/TeamController.js:462–477  ·  view source on GitHub ↗
(teamId, userData, body)

Source from the content-addressed store, hash-verified

460 }
461
462 async createApiKey(teamId, userData, body) {
463 try {
464 const token = jwt.sign({
465 id: userData.id,
466 email: userData.email,
467 }, settings.encryptionKey, { expiresIn: "9999 years" });
468
469 return await db.Apikey.create({
470 name: body.name,
471 team_id: teamId,
472 token,
473 });
474 } catch (e) {
475 return Promise.reject(e);
476 }
477 }
478
479 getApiKeys(teamId) {
480 return db.Apikey.findAll({ where: { team_id: teamId } })

Callers 1

TeamRoute.jsFile · 0.80

Calls 1

createMethod · 0.45

Tested by

no test coverage detected