Ionic Auth GET user id


I want to get my user id , but i can´t . How is it possible to get i?


The Ionic Auth documentation doesn’t mention an ID at all: Only for custom auth where it refers to the user_id of the custom auth service being implemented:

May I ask why you need it and what you are trying to achieve?

@Sujan12 i am doing an app for iot control. I want to filter user devices and i thought that user id is the best option to do that.

I have found the solution:

this.db.collection('devices').findAll({creator:}).fetch().subscribe( (devices) => {
  this.devices = devices;
}, (error) => {

you can call and get the id.


1 Like

Would mind let me know where do you put your code at? controller?

Ionic Auth is closing soon. Instead of getting it to work, you’d be better off finding a different auth provider.

1 Like