mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Auth: avoid some authentication errors when manipulation accounts
This commit is contained in:
parent
c9df435fc0
commit
6cc55ab4ed
2 changed files with 12 additions and 19 deletions
|
|
@ -506,12 +506,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
|
||||
// We reached here without hitting the goto: the new settings are correct, so replace the previous ones.
|
||||
|
||||
// add auth info
|
||||
linphone_core_clear_all_auth_info(lc);
|
||||
if (info) {
|
||||
linphone_core_add_auth_info(lc, info);
|
||||
}
|
||||
|
||||
// setup new proxycfg
|
||||
if (isEditing) {
|
||||
linphone_proxy_config_done(proxyCfg);
|
||||
|
|
@ -521,6 +515,13 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
linphone_core_set_default_proxy_config(lc, proxyCfg);
|
||||
}
|
||||
|
||||
// add auth info only after finishing editting the proxy config, so that
|
||||
// UNREGISTER succeed
|
||||
linphone_core_clear_all_auth_info(lc);
|
||||
if (info) {
|
||||
linphone_core_add_auth_info(lc, info);
|
||||
}
|
||||
|
||||
bad_proxy:
|
||||
if (linphoneAddress)
|
||||
linphone_address_destroy(linphoneAddress);
|
||||
|
|
|
|||
|
|
@ -922,19 +922,11 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
|
|||
addButtonWithTitle:NSLocalizedString(@"Continue", nil)
|
||||
block:^{
|
||||
NSString *password = [alertView textFieldAtIndex:0].text;
|
||||
LinphoneAuthInfo *info = (LinphoneAuthInfo *)linphone_core_find_auth_info(
|
||||
[LinphoneManager getLc], realm.UTF8String, username.UTF8String, domain.UTF8String);
|
||||
if (info) {
|
||||
linphone_auth_info_set_passwd(info, password.UTF8String);
|
||||
linphone_auth_info_set_ha1(info, NULL);
|
||||
} else {
|
||||
LOGW(@"Could not find auth info associated with %@@%@, creating it", username, domain);
|
||||
info = linphone_auth_info_new(username.UTF8String, NULL, password.UTF8String, NULL,
|
||||
realm.UTF8String, domain.UTF8String);
|
||||
linphone_core_add_auth_info([LinphoneManager getLc], info);
|
||||
}
|
||||
linphone_proxy_config_refresh_register(
|
||||
linphone_core_get_default_proxy_config([LinphoneManager getLc]));
|
||||
LinphoneAuthInfo *info =
|
||||
linphone_auth_info_new(username.UTF8String, NULL, password.UTF8String, NULL,
|
||||
realm.UTF8String, domain.UTF8String);
|
||||
linphone_core_add_auth_info([LinphoneManager getLc], info);
|
||||
[LinphoneManager.instance refreshRegisters];
|
||||
}];
|
||||
[alertView show];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue