Auto Login

AutoLogin is a functionality that enables you to use your Login system and get users validated at Conscent.ai System.

A temporary token is generated using an API and this token needs to be stored at Client's end.

POST {API_URL}/client/generate-temp-token

Authorization:

Client API Key and API Secret must be passed in Authorization Headers using Basic Auth. With API Key as the Username and API Secret as the password.

Request Body

NameTypeDescription

email*

String

email of the user

phoneNumber*

String

phone number of the user

clientId*

String

Client Id of the client

You need to pass either the phone number or email of the user from which they have made the purchase.

 csc('auto-login', {
      clientId: clientId,
      token: tokenEntered,
      phone: data?.phoneNumber,
      email: data?.email,
      successCallbackFunction: async (userDetailsObject: any) => {
        setShowLoginDetails(true);
        console.log('Success callback received from conscent auto Login', userDetailsObject);
        alert('login successfull');
      },
      errorCallbackFunction: (errorObject: any) => {
        console.error(errorObject);
        alert('login unsuccessfull');
      },
      unauthorizedCallback: () => {
        console.log('unauthorized callback called');
      },
    });

Last updated