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 orcotter.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 orcotter.trustedDevice.removeDevice from a non-trusted device?

Will get err: β€œThis device is not a trusted device.”

Last updated