overwolf.profile.getCurrentUser()

Hey guys,

I’m currently implementing a component (react with typescript) to display the overwolf user (or at least some of the information). I want to display name and avatar, which works great.

So there is a little issue during testing. I have to be logged in, to get the right result by the api and even start the app to test. But when logged out, i cant open the app and so can`t test the state and response of the custom hook.

Is there a workaround or way of properly testing it?

thanks for helping

Hi,

Would you mind telling me what you are trying to achieve?

I’m not sure that I clearly understand your issue. You have to be logged in to get some info on the current user. You can’t get it when the user is logged out.

Also, can you clarify what you mean by "But when logged out, I can’t open the app ".

Hi,

I develop locally and let the app running by importing the unpacked app. To start it from the packages, i have to be logged in. Otherwise I cant launch it.

This disappears when logged out of overwolf.

You can see the result of that function here: https://overwolf.github.io/docs/api/overwolf-profile#getcurrentuserresult-object

When user is not logged in you will get this:

{  
   "success": false,
   "error": "Not signed in",
   "status":"error",
    "reason":"Not signed in",
   "username":null,
   "userId":"OW_34153336-192b-44f6-aa0f-4a9b744c689d",
   "machineId":"653000ad-001c-43e9-a5c9-e23db5ad370a",
   "partnerId":0,
   "channel":"website",
   "parameters":{"no-ftue":null},
   "installParams":null,
   "avatar":""
}

Gabriel

1 Like