File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,16 @@ async function updateRecord (req, res) {
6464 const username = await checkAuth ( req )
6565 if ( ! username ) return unauthorized ( res )
6666 let config = await json ( req )
67- if ( config . screepsAPIConfig && config . screepsAPIConfig . token && config . screepsAPIConfig . token . includes ( '*' ) ) {
68- delete config . screepsAPIConfig
69- }
70- if ( config . screepsAPIConfig && config . screepsAPIConfig . password && config . screepsAPIConfig . password . match ( / ^ \* { 8 } $ / ) ) {
71- delete config . screepsAPIConfig
67+ if ( config . screepsAPIConfig ) {
68+ if ( config . screepsAPIConfig . privateServer ) {
69+ if ( config . screepsAPIConfig . password && config . screepsAPIConfig . password . match ( / ^ \* { 8 } $ / ) ) {
70+ delete config . screepsAPIConfig
71+ }
72+ } else {
73+ if ( config . screepsAPIConfig . token && config . screepsAPIConfig . token . includes ( '*' ) ) {
74+ delete config . screepsAPIConfig
75+ }
76+ }
7277 }
7378 config . lastErrorText = ''
7479 await req . db . Config . update ( config , { where : { pk : config . pk , username } } )
You can’t perform that action at this time.
0 commit comments