Hello @Pitchaimani
The response you get in this getLoggedInUser()
method is based on what details you are locking in the deadlock. This method retrieves data from the service named "deadlock"
; thus, the response is determined by the information stored within the deadlock service.
Therefore, please ensure that the RRID field is included when a user signs up for the first time. This data will be stored in deadlock and subsequently accessible in the output of getLoggedInUser()
when calling the session API.
We use this method to store the details in deadlock
let res = await applicationClient.user.createUser({
body: obj,
});
To help you understand better, sharing one example:
We use this getLoggedInUser() function as a session API when users log in to the storefront. Sharing the response below:
{
"status": 200,
"data": {
"user": {
"_id": "659555bd4d06399365d7a829",
"username": "jm786_605c6efd5ab8c845def75ae3",
"emails": [
{
"email": "[email protected]",
"active": true,
"primary": true,
"verified": true
}
],
"gender": "male",
"active": true,
"meta": {
"sub": "7010881261",
"mobile": "917010881261",
"type": "COFO",
"exp": 1706642048,
"iat": 1706606048,
"gstn": "",
"pan": "",
"email": null,
"user_login": "JM786",
"first_name": "Afroz",
"last_name": "change)",
"department_number": "R3",
"prm_id": "JM786",
"approved_at": null,
"store_code": "JM9320",
"tenant_name": "JMD",
"tenant_id": "6486ce36515ae7145039f6a8"
},
"first_name": "Afroz",
"last_name": "change)",
"phone_numbers": [
{
"phone": "7010881261",
"active": true,
"primary": true,
"verified": true,
"country_code": 91
}
],
"account_type": "user",
"profile_pic_url": "https://hdn-1.fynd.com/company/884/applications/000000000000000000000001/theme/pictures/free/original/default-profile_nxhzui.png",
"user_id": "659555bd4d06399365d7a829",
"application_id": "605c6efd5ab8c845def75ae3",
"created_at": "2024-01-03T12:40:29.857Z",
"updated_at": "2024-01-30T09:14:08.463Z"
}
}
}
Within this response, you will notice that we have included certain unique fields according to our requirements, such as PRMId, meta.user, etc.