|
|
@@ -41,9 +41,6 @@ module.exports = function(crowi, app) {
|
|
|
var email = registerForm.email;
|
|
|
var password = registerForm.password;
|
|
|
var language = registerForm['app:globalLang'] || (req.language || 'en-US');
|
|
|
- // for config.globalLang setting.
|
|
|
- var langForm = {};
|
|
|
- langForm['app:globalLang'] = language;
|
|
|
|
|
|
User.createUserByEmailAndPassword(name, username, email, password, language, function(err, userData) {
|
|
|
if (err) {
|
|
|
@@ -60,6 +57,11 @@ module.exports = function(crowi, app) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // save the globalLang config, and update the config cache
|
|
|
+ Config.updateNamespaceByArray('crowi', {'app:globalLang': language}, function(err, config) {
|
|
|
+ Config.updateConfigCache('crowi', config);
|
|
|
+ });
|
|
|
+
|
|
|
// login with passport
|
|
|
req.logIn(userData, (err) => {
|
|
|
if (err) { return next() }
|
|
|
@@ -73,11 +75,6 @@ module.exports = function(crowi, app) {
|
|
|
// create initial pages
|
|
|
createInitialPages(userData, language);
|
|
|
});
|
|
|
-
|
|
|
- // save config settings, and update config cache
|
|
|
- Config.updateNamespaceByArray('crowi', langForm, function(err, config) {
|
|
|
- Config.updateConfigCache('crowi', config);
|
|
|
- });
|
|
|
});
|
|
|
}
|
|
|
else {
|