@@ -6,6 +6,7 @@ const route = new Router();
6
6
7
7
const ApiUser = require ( './model' ) . ApiUser ;
8
8
const filters = require ( './filters' ) ;
9
+ const keygen = require ( '../../lib/keygen' ) ;
9
10
10
11
const APPS_FREE = process . env . APPS_FREE || 1 ;
11
12
@@ -153,6 +154,14 @@ route.post('/:id', (req, res, next) => {
153
154
req . app . set ( 'url' , req . body . url || undefined ) ;
154
155
req . app . set ( 'desc' , req . body . desc ) ;
155
156
157
+ if ( req . body . generate_key_dev ) {
158
+ req . app . set ( 'key.dev' , keygen ( ) ) ;
159
+ }
160
+
161
+ if ( req . body . generate_key_prod ) {
162
+ req . app . set ( 'key.prod' , keygen ( ) ) ;
163
+ }
164
+
156
165
// Prod rate-limit change request
157
166
if ( parseInt ( req . body . limit_prod , 10 ) !== req . app . limit . prod ) {
158
167
req . app . limit . prodRequest = parseInt ( req . body . limit_prod , 10 ) ;
@@ -183,8 +192,8 @@ route.post('/:id', (req, res, next) => {
183
192
184
193
req . session . message = {
185
194
class : 'positive' ,
186
- title : 'App ppdatert ' ,
187
- message : `Applikasjon " ${ req . body . name } " ble oppdatert suksessfullt .` ,
195
+ title : 'App oppdatert ' ,
196
+ message : `Applikasjonen « ${ req . body . name } » ble oppdatert.` ,
188
197
app : req . app . _id ,
189
198
} ;
190
199
@@ -205,7 +214,7 @@ route.post('/:id/disable', (req, res, next) => {
205
214
req . session . message = {
206
215
class : 'positive' ,
207
216
title : 'App deaktivert' ,
208
- message : `Applikasjon " ${ req . app . name } " ble deaktivert!` ,
217
+ message : `Applikasjonen « ${ req . app . name } » ble deaktivert!` ,
209
218
app : req . app . _id ,
210
219
} ;
211
220
0 commit comments