> For the complete documentation index, see [llms.txt](https://docs.cotter.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cotter.app/sdk-reference/ios/ios-sdk-passwordless-login/remove-trusted-device.md).

# Remove Trusted Device

You can remove the current device from being a trusted device.

> In the future, you can also revoke other trusted devices from any trusted device.

## Removing this Trusted Device

To remove the current device from being a trusted device, do the following:

Example:

```swift
class SomeUIVC: UIViewController {
  @IBOutlet weak var textLabel: UILabel!

  var cotter: Cotter?

  override func viewDidLoad() {
    super.viewDidLoad()

    self.cotter = Cotter(
      apiSecretKey: "588d6f67-0981-4718-899b-bcd512de1aca",
      apiKeyID: "w4FK6Zz0XIhtGY3o5biI",
      cotterURL: "https://www.cotter.app/api/v0",
      userID: "hello@example.com",
      configuration: [:]
    )
  }

  // On Button Click
  @IBAction func removeTrustedDevice(_ sender: Any) {
    func callback(token: String, err: Error?) {
      if err != nil {
        self.textLabel.text = err?.localizedDescription
        return
      }
      self.textLabel.text = token
    }

    CotterWrapper.cotter?.removeTrustedDevice(vc: self, cb: callback)
  }
}
```

For the above callback, a text label will be populated to let the user know whether the removal succeeded or failed. Otherwise, if desired, the user can also perform a segue to another view controller in the callback function as well.

For the above example, clicking on the button linked to `removeTrustedDevice` in the view controller will make a request to remove the current device as a trusted device. If the request is successful, no error will exist, and a text label will be populated to let the user know whether the removal succeeded or failed. Otherwise, if desired, the user can also perform a segue to another view controller (on success or failure) in the callback function as well.

> You cannot remove the last Trusted Device. You will need to have 1 remaining Trusted Device.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cotter.app/sdk-reference/ios/ios-sdk-passwordless-login/remove-trusted-device.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
