# FAQ

### **Why do I get an error saying "user already exist" when calling `cotter.signUpWithDevice` or `cotter.trustedDevice.enrollDevice` ?**

This function does 2 things: register a new user to Cotter and enroll the current device as a trusted device. Calling **`signUpWithDevice`** or `enrollDevice` for a user ID that already exist in Cotter will result in the error "user already exist".

For example, this can happen when you:

* Call cotter.trustedDevice.enrollDevice from an already trusted device.
* Call cotter.trustedDevice.enrollDevice from a device B, when device A has already been registered as a trusted device.

Also note that **`signUpWithDevice`**  & **`enrollDevice` only works on the user's first ever trusted device**. For additional trusted devices, you have to use the **Add New Trusted Device** method using the QR code.

### **What happens if you call `cotter.trustedDevice.getNewEvent` with a non-trusted device?**

Nothing happens. `getNewEvent` fetches a new un-approved authentication request that are generated when the user tries to login from a non-trusted device. However, since you're calling `getNewEvent` from a non-trusted device, this device cannot approve the request.

### **What happens if you call `signInWithDevice` or`cotter.trustedDevice.reqAuth` when you have not registered the user with Cotter yet?**

Will get errMsg: “Something went wrong”. You need a user that is registered to Cotter to be able to use any trusted device functionalities, except **`signUpWithDevice`**  & **`enrollDevice`** (because that function will also register a new user to Cotter for you).

### **What happens if you call `user.removeDevice` or`cotter.trustedDevice.removeDevice` from a non-trusted device?**

Will get err: “This device is not a trusted device.”


---

# Agent Instructions: 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:

```
GET https://docs.cotter.app/sdk-reference/react-native/faq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
