File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function CreateApiKeyHandler (db) {
9
9
const users = await db . readAll ( 'users' )
10
10
11
11
const apiKeyExists = users . map ( ( user ) => {
12
- return user . apiKey === apikey
12
+ return user . apiKey . includes ( apikey )
13
13
} )
14
14
15
15
if ( apiKeyExists . includes ( true ) ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ function CreateFeedbackHandler (db) {
11
11
const {
12
12
type,
13
13
text,
14
+ apiKey,
14
15
fingerprint,
15
16
device,
16
17
page
@@ -36,6 +37,10 @@ function CreateFeedbackHandler (db) {
36
37
ctx . status = 400
37
38
ctx . body = { error : 'page is empty' }
38
39
}
40
+ if ( ! apiKey ) {
41
+ ctx . status = 400
42
+ ctx . body = { error : 'apiKey is empty' }
43
+ }
39
44
40
45
if ( ! FEEDBACK_TYPES [ String ( type ) . toUpperCase ( ) ] ) {
41
46
ctx . status = 422
@@ -47,6 +52,7 @@ function CreateFeedbackHandler (db) {
47
52
text,
48
53
fingerprint,
49
54
id : uuidv4 ( ) ,
55
+ apiKey,
50
56
type : String ( type ) . toUpperCase ( ) ,
51
57
device,
52
58
page,
Original file line number Diff line number Diff line change
1
+ FROM node:13-alpine as build
2
+
3
+ WORKDIR /
4
+
5
+ COPY . .
6
+
7
+ ENV NODE_ENV=production
8
+ RUN npm install --production
9
+ RUN npm run build
10
+
11
+ FROM nginx:1.18.0-alpine as final
12
+
13
+ WORKDIR /
14
+ COPY --from=build ./dist /usr/share/nginx/html
You can’t perform that action at this time.
0 commit comments