Skip to content

Commit

Permalink
Merge pull request #47 from AtB-AS/mikael/invite-key
Browse files Browse the repository at this point in the history
feat: adds ticket invite key env to build
  • Loading branch information
mikaelbr authored Nov 9, 2020
2 parents a8f0565 + e9bec75 commit c9e57ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/enrollment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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'] };
}

Expand Down
2 changes: 2 additions & 0 deletions src/config/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const TICKET_INVITE_KEY: string | undefined =
process.env.TICKET_INVITE_KEY;

0 comments on commit c9e57ab

Please sign in to comment.