Apple is introducing a revamped two-factor authentication system in iOS 9 and OS X El Capitan, according to support documents published by the company. The feature will be used to secure iPhones, iPads, iPods and Macs from unauthorized access, even if someone manages to obtain a user’s password.

Two-factor authentication does this by sending a verification code to a trusted device, such as an iPhone or MacBook. This code must be used in addition to a password when logging in with an Apple ID from a new device. Additionally, users can also opt to send the verification code to a mobile phone or home phone, in case those trusted devices are unavailable.

Though the feature is similar to “two-step verification” introduced to Apple ID accounts in 2013, Apple said in its support documents that it uses different methods to trust devices and deliver the codes. The older feature will continue to work separately from two-factor authentication.

The way it works is any iPhone or Mac on iOS 9 on OS X El Capitan can become a trusted device after signing into an Apple ID using two-factor authentication. The previous feature was limited to iPhones, iPads and iPod Touches with Find My iPhone enabled.

If an iPhone owner loses access to their account and doesn’t have a trusted device nearby, they can also request an account recovery from Apple, by providing a verified phone number to be reached at via text or phone call. Apple will then review the case and return access to the account -- as long as there’s sufficient information to verify that they’re the real owner.

This replaces the recovery key from two-step verification, which was provided when users activated the feature for the first time, according to Macworld. While it was designed to allow Apple customers to get back into their account in the case of a lockout, in some instances those that lost the key were forced to abandon their Apple ID.

Apple is expected to launch a public beta test for iOS 9 in July, followed by a release this fall alongside the anticipated "iPhone 6S."