Skip to content

Commit 72bf305

Browse files
authored
Merge pull request #50 from demokratie-live/sprint#9/env-variables-blocking
handle mission env valriables for development
2 parents 994160f + 13a3a11 commit 72bf305

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SECRET_KEY=
2-
AUTH_JWT_SECRET=
1+
SECRET_KEY=CHANGE_ME
2+
AUTH_JWT_SECRET=CHANGE_ME
33
ENGINE_API_KEY=
44
APPLE_TEAMID=
55
APPLE_APN_KEY_ID=

src/services/notifications/apn.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import apn from 'apn';
2+
import _ from 'lodash';
23

34
let apnProvider; // eslint-disable-line
45

@@ -9,10 +10,19 @@ if (!apnProvider) {
910
keyId: process.env.APPLE_APN_KEY_ID,
1011
teamId: process.env.APPLE_TEAMID,
1112
},
12-
production: false,
13+
production: false, // TODO: handle APLPHA/BETA/PRODUCTION
1314
};
1415

15-
apnProvider = new apn.Provider(options);
16+
if (_.filter(options.token, option => !option).length > 0) {
17+
apnProvider = new Proxy(
18+
{},
19+
{
20+
get: console.log,
21+
},
22+
);
23+
} else {
24+
apnProvider = new apn.Provider(options);
25+
}
1626
}
1727

1828
export default apnProvider;

0 commit comments

Comments
 (0)