diff --git a/AABrowserAPI/TeamSetup.js b/AABrowserAPI/TeamSetup.js index a7397b064..2360c4c2e 100644 --- a/AABrowserAPI/TeamSetup.js +++ b/AABrowserAPI/TeamSetup.js @@ -537,23 +537,26 @@ }; usersModuleAPI.query(` - mutation($authId: String, $sessionToken: String){ - updateSessionToken(authId: $authId, sessionToken: $sessionToken){ - id - alias - } - } - `, variables, function (req, res) { - if (res.status === 401) { - console.log('Error trying to save the session token at the Users Module'); - } - }).then(res => { - if (res.errors) { - console.log('Error trying to save the session token at the Users Module'); - } - }).catch(error => { - console.log('Error trying to save the session token at the Users Module'); - }); + mutation($authId: String, $sessionToken: String){ + updateSessionToken(authId: $authId, sessionToken: $sessionToken){ + id + alias + } + } + `, variables, function (req, res) { + if (res.status === 401) { + console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> res.status = 401'); + } + }).then(res => { + if (res.errors) { + console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> res.errors = ' + res.errors); + } + }).catch(error => { + console.log('Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> errors = ' + errors); + }); } catch (err) { diff --git a/server.js b/server.js index 8f447e50f..2c4b77282 100644 --- a/server.js +++ b/server.js @@ -595,6 +595,14 @@ function onBrowserRequest(request, response) { function onSetupFinished(err) { + if (err.result === global.DEFAULT_OK_RESPONSE.result) { + + /* We must re-load all the webserver caches.*/ + + initialize(); + + } + respondWithContent(JSON.stringify(err), response); } break;