GetUserId() in Mobile

  

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Solution

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Solution

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


Just be careful with the data you'll store in your local storage, for security reasons.

Cheers,

GM


Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


Just be careful with the data you'll store in your local storage, for security reasons.

Cheers,

GM


Certainly!  I'm only storing Name, username, and timestamps.

Appreciate the help.