diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index 227f103d7..40ce07441 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -603,20 +603,20 @@ if (creds) { [SOGoSession deleteValueForSessionKey: [creds objectAtIndex: 1]]; - - if ([domain isNotNull]) - { - sd = [SOGoSystemDefaults sharedSystemDefaults]; - if ([sd enableDomainBasedUID] && - [username rangeOfString: @"@"].location == NSNotFound) - username = [NSString stringWithFormat: @"%@@%@", username, domain]; - } - - authCookie = [auth cookieWithUsername: username - andPassword: newPassword - inContext: context]; - [response addCookie: authCookie]; } + + if ([domain isNotNull]) + { + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([sd enableDomainBasedUID] && + [username rangeOfString: @"@"].location == NSNotFound) + username = [NSString stringWithFormat: @"%@@%@", username, domain]; + } + + authCookie = [auth cookieWithUsername: username + andPassword: newPassword + inContext: context]; + [response addCookie: authCookie]; } else response = [self _responseWithLDAPPolicyError: error];