CompleteSignup

How to complete signup a user through the Cosync REST API

Complete the signup user account with a verification code. This function will cause the CosyncJWT portal to verify a six digit verification code with the user handle for verification. If the code passed matches the code in the Signup record, the handleVerified flag will be set to true. This function is only used if the signup flow for the application is set to code.

This call will return a JWT token for the signed up user, an access token for REST calls, and a signed token used by the server to validate the complete signup.

The signed user token will contain:

  • handle - user email handle
  • code - user signup code
  • appId - CosyncJWT application id
  • metaData - user metadata if passed
  • iat - time at which claim was issued

The metaData is the metadata data that was sent as part of signup function call.

URL
/api/appuser/completeSignup
Method
POST
Headers
app-token: "<App Token>"
Data Parameter
    {
        handle: "<user handle>",
		code: "<verification code>"
    }

Response:

Success:

StatusCode:
    200 (OK)
Contents:
    {
        jwt: "<JWT for logged in user>",
        access-token: "<access token for user>",
        signed-user-token: "<signed user token>"
    }

Error:

StatusCode:
    400 (BAD REQUEST)
    500 (INTERNAL SERVER ERROR)
Content:
    {
        code: "<internal error code>",
        message: "<readable error description>"
    }

The internal codes are integers:

  • 400 - invalid app token
  • 401 - app no longer exists
  • 402 - app is suspended
  • 403 - missing parameter
  • 404 - user account is suspended
  • 407 - app does not support signup
  • 411 - signup code expired
  • 500 - internal server error
  • 601 - handle already registered
  • 603 - invalid data