Make local auth more robust
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / UserAdminLoginModule.java
index b95d0577000c8591dd8c0c700c68cb9ce72c5b90..4862c57ac03a0faf0ddc5cb0e4f14f2e298f2562 100644 (file)
@@ -167,7 +167,10 @@ public class UserAdminLoginModule implements LoginModule {
 
        @Override
        public boolean commit() throws LoginException {
-               subject.getPublicCredentials().add(locale);
+               if (locale == null)
+                       subject.getPublicCredentials().add(Locale.getDefault());
+               else
+                       subject.getPublicCredentials().add(locale);
 
                if (singleUser) {
                        OsUserUtils.loginAsSystemUser(subject);