Cotter
  • 🚀Getting Started
  • Features & Concepts
    • 💬Sign In with Email/Phone Number
    • 🔐Sign In with Device
      • How it works
    • 🧬Sign In with WebAuthn
  • 📌Quickstart Guides
    • All Guides & Tutorials
    • HTML – Sign in with Email/Phone
    • React – Sign in with Email/Phone
    • React – WebAuthn
    • ▲ Next.js
    • Angular
    • Webflow
    • Bubble.io
    • Python SDK for a CLI
    • React Native – Sign in with Device
    • iOS – Sign in with Device
    • Flutter – Sign in with Device
  • 📘SDK Reference
    • Web
      • Sign In with Email/Phone Number
        • Customize the Form
        • Checking the email or phone before sending a verification code
        • Sending Code or Link via WhatsApp
        • Styling
        • Older SDK
          • Customize the Form
      • Sign in with Social Login
        • Getting Access Tokens from Social Login Providers
        • Github Instructions
        • Google Instructions
      • Sign In with WebAuthn
        • Register WebAuthn for a logged-in user
      • Sign In with Device
        • Steps for Pop Up Authentication Prompt
        • Advanced Customization for Login Form
        • Advanced Customization for Pop Up Authentication Prompt
      • Getting Access Token and Logged-In User Info
      • Sending Successful Form Submission
      • FAQ & Troubleshooting
    • React Native
      • Installation
      • Sign In with Device
        • Add Email/Phone Verification
        • Authenticate from a Non-Trusted Device
        • Add a new Trusted Device
        • Remove Trusted Device
      • Sign In with Email/Phone Number
      • Getting Stored OAuth Tokens and User Information
      • FAQ
      • Older SDK Versions
        • Sign in with Email/Phone
        • Sending Code via WhatsApp
        • Sign In with Device
          • Authenticate from a Non-Trusted Device
          • Add a new Trusted Device
          • Customization
    • Flutter
      • Sign In with Device
        • Add Email/Phone Verification
        • Authenticate from a Non-Trusted Device
      • Sign in with Email/Phone Number
      • Getting the Logged-in User
      • Getting OAuth Tokens
      • Signing a User Out
    • iOS
      • Sign In with Email/Phone Number
      • Sign In with Device
        • Authenticate from a Non-Trusted Device
        • Push Notification
        • Check if Trusted Device is Enrolled
        • Add a New Trusted Device
        • Remove Trusted Device
      • Older Versions
        • Biometric/Pin
    • Android
      • Sign In with Device
        • Authenticate from a Non-Trusted Device
        • Check if Trusted Device is Enrolled
        • Add a new Trusted Device
        • Remove Trusted Device
        • Customization
      • Sign In with Email/Phone Number
      • Biometric/Pin
        • Advanced Methods
        • Customization
        • Setting Strings
        • Styling
      • Older SDK Version
        • Sign In with Device
          • Authenticate from a Non-Trusted Device
    • Python (for CLI)
    • API for Other Mobile Apps or CLI
      • Verify Email/Phone Number
        • Handling URL Scheme
    • Backend: Handling Response
  • 🛡️ Protecting Your Account
    • Only Allow Your Website/App to Use Your API Key
    • Rate Limit
    • Enable reCAPTCHA to Protect Against Automated Abuse
  • 🗝️ Getting Access Token
    • Cotter's OAuth 2.0 Tokens Specification
    • Getting the Tokens
      • Get Tokens during Authentication
      • Using the Refresh Token
    • Storing and Removing Tokens
    • Renewing Expired Tokens
    • Verifying JWT Tokens
    • Requesting Custom Fields on your JWT Token
    • Older API
      • Using HTTP Requests
      • Getting the Tokens
        • During Authentication
          • During Email/Phone Verification
        • During enrolling Trusted Devices
  • 🔌API Reference
    • User API
      • User Object
    • OAuth Tokens API
      • Verify JWT Token using API (serverless)
      • Requesting Custom Claims on your Access Token
      • Older API
    • OAuth Tokens from Social Login
    • Event Object
    • Reset PIN API
  • Older API
    • Validating Cotter's Identity Token
    • Validating Cotter's Event Response
Powered by GitBook
On this page
  • Why do I get an error saying "user already exist" when calling cotter.signUpWithDevice or cotter.trustedDevice.enrollDevice ?
  • What happens if you call cotter.trustedDevice.getNewEvent with a non-trusted device?
  • What happens if you call signInWithDevice orcotter.trustedDevice.reqAuth when you have not registered the user with Cotter yet?
  • What happens if you call user.removeDevice orcotter.trustedDevice.removeDevice from a non-trusted device?
  1. SDK Reference
  2. React Native

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 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.”

PreviousGetting Stored OAuth Tokens and User InformationNextOlder SDK Versions

Last updated 4 years ago

📘