diff --git a/src/api/enrollment/index.ts b/src/api/enrollment/index.ts index fde1a6f4..63231879 100644 --- a/src/api/enrollment/index.ts +++ b/src/api/enrollment/index.ts @@ -2,6 +2,7 @@ import Hapi from '@hapi/hapi'; import { EnrollmentQuery } from '../../service/types'; import { postEnrollmentGroupRequest } from './schema'; import * as Boom from '@hapi/boom'; +import { TICKET_INVITE_KEY } from '../../config/env'; export default (server: Hapi.Server) => () => { server.route({ @@ -15,7 +16,7 @@ export default (server: Hapi.Server) => () => { handler: async (request, h) => { const query = (request.query as unknown) as EnrollmentQuery; - if (query.inviteKey === 'hurrafordeg') { + if (TICKET_INVITE_KEY && TICKET_INVITE_KEY === query.inviteKey) { return { status: 'ok', groups: ['ticketing_group'] }; } diff --git a/src/config/env.ts b/src/config/env.ts new file mode 100644 index 00000000..e90779a6 --- /dev/null +++ b/src/config/env.ts @@ -0,0 +1,2 @@ +export const TICKET_INVITE_KEY: string | undefined = + process.env.TICKET_INVITE_KEY;